apk-tools/src/Makefile

147 lines
4.6 KiB
Makefile
Raw Normal View History

PKG_CONFIG ?= pkg-config
add script to autogenerate help from man pages This creates main help like: -- usage: apk [<OPTIONS>...] COMMAND [<ARGUMENTS>...] Package installation and removal: add Add packages to WORLD and commit changes del Remove packages from WORLD and commit changes System maintenance: fix Check WORLD against the system and ensure consistency update Update repository indexes upgrade Install upgrades available from repositories cache Commands related to the management of an offline package cache Querying package information: info Give detailed information about packages or repositories list List packages matching a pattern or other criteria dot Generate graphviz graphs policy Show repository policy for packages Repository maintenance: index Create repository index file from packages fetch Download packages from global repositories to a local directory manifest Show checksums of package contents verify Verify package integrity and signature Miscellaneous: audit Audit directories for changes stats Show statistics about repositories and installations version Compare package versions or perform tests on version strings This apk has coffee making abilities. -- And applet specific help like: -- usage: apk add [<OPTIONS>...] PACKAGES... Description: apk add adds the requested packages to WORLD and installs (or upgrades) them if not already present, ensuring all dependencies are met. Options: --initdb Initialize a new package database -l, --latest Disables normal heuristics for choosing which repository to install a -u, --upgrade When adding packages which are already installed, upgrade them rather -t, --virtual NAME Instead of adding the specified packages to WORLD, create a new --no-chown Do not change file owner or group --
2020-04-24 08:49:14 +00:00
LUA ?= $(firstword $(wildcard /usr/bin/lua5.3 /usr/bin/lua5.2))
ifeq ($(LUA),no)
LUAAPK ?= no
else ifneq ($(LUA),)
LUAAPK ?= yes
else
$(error Lua interpreter not found. Please specify LUA interpreter, or use LUA=no to build without help.)
endif
OPENSSL_CFLAGS := $(shell $(PKG_CONFIG) --cflags openssl)
OPENSSL_LIBS := $(shell $(PKG_CONFIG) --libs openssl)
ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib)
ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib)
SODIUM_FLAGS := $(shell $(PKG_CONFIG) --cflags libsodium)
SODIUM_LIBS := $(shell $(PKG_CONFIG) --libs libsodium)
# Dynamic library
libapk_soname := 2.99.0
libapk_so := $(obj)/libapk.so.$(libapk_soname)
libapk.so.$(libapk_soname)-objs := \
adb.o adb_comp.o adb_walk_adb.o adb_walk_genadb.o adb_walk_gentext.o adb_walk_text.o apk_adb.o \
atom.o blob.o commit.o common.o context.o crypto_core.o crypto_digest.o crypto_public.o crypto_secret.o \
database.o hash.o extract_v2.o extract_v3.o fs_fsys.o fs_uvol.o io.o io_gunzip.o io_url.o tar.o \
package.o pathbuilder.o print.o solver.o trust.o version.o
libapk.so.$(libapk_soname)-libs := libfetch/libfetch.a
shlibs-y += libapk.so.$(libapk_soname)
LDFLAGS_libapk.so.$(libapk_soname) += -Wl,-soname,libapk.so.$(libapk_soname)
install-libapk_so := $(INSTALLDIR) $(DESTDIR)$(LIBDIR) && \
$(INSTALL) $(libapk_so) $(DESTDIR)$(LIBDIR) && \
$(LN) libapk.so.$(libapk_soname) $(DESTDIR)$(LIBDIR)/libapk.so
# Static library
libapk.a-objs := $(libapk.so.$(libapk_soname)-objs)
libapk.a-libs := $(libapk.so.$(libapk_soname)-libs)
libs-y += libapk.a
libapk_a := $(obj)/libapk.a
install-libapk_a := $(INSTALLDIR) $(DESTDIR)$(LIBDIR) && \
$(INSTALL) $(libapk_a) $(DESTDIR)$(LIBDIR)
apk-static-libs := $(libapk.a-libs) $(obj)/libapk.a
# Lua module
ifeq ($(LUAAPK),yes)
LUA_VERSION ?= 5.3
LUA_PC ?= lua$(LUA_VERSION)
LUA_LIBDIR ?= /usr/lib/lua/$(LUA_VERSION)
2010-03-06 19:07:38 +00:00
shlibs-y += apk.so
apk.so-objs := lua-apk.o
CFLAGS_lua-apk.o := -DAPK_VERSION=\"$(FULL_VERSION)\" \
$(shell $(PKG_CONFIG) $(LUA_PC) --cflags)
apklua_so := $(obj)/apk.so
install-apklua_so := $(INSTALLDIR) $(DESTDIR)$(LUA_LIBDIR) && \
$(INSTALL) $(apklua_so) $(DESTDIR)$(LUA_LIBDIR)
endif
2010-03-06 19:07:38 +00:00
# Apk utility
progs-y += apk
apk-objs := \
apk.o app_adbdump.o app_adbsign.o app_add.o app_audit.o app_cache.o \
app_convdb.o app_convndx.o app_del.o app_dot.o app_extract.o app_fetch.o \
app_fix.o app_index.o app_info.o app_list.o app_manifest.o app_mkndx.o \
app_mkpkg.o app_policy.o app_update.o app_upgrade.o app_search.o \
app_stats.o app_verify.o app_version.o app_vertest.o applet.o
2010-03-05 08:13:25 +00:00
ifeq ($(ADB),y)
libapk.so.$(libapk_soname)-objs += apk_adb.o
apk-objs += app_adbdump.o app_adbsign.o app_mkndx.o \
app_convdb.o app_convndx.o
endif
LIBS_apk := -lapk
LIBS_apk-test := -lapk
LIBS_apk.so := -L$(obj) -lapk
CFLAGS_ALL += -D_ATFILE_SOURCE -Ilibfetch -Iportability
CFLAGS_apk.o := -DAPK_VERSION=\"$(FULL_VERSION)\"
CFLAGS_apk-static.o := -DAPK_VERSION=\"$(FULL_VERSION)\" -DOPENSSL_NO_ENGINE
CFLAGS_apk-test.o := -DAPK_VERSION=\"$(FULL_VERSION)\" -DOPENSSL_NO_ENGINE -DTEST_MODE
progs-$(STATIC) += apk.static
apk.static-objs := $(filter-out apk.o,$(apk-objs)) apk-static.o
apk.static-libs := $(apk-static-libs)
LDFLAGS_apk.static := -static
LIBS_apk.static := -Wl,--as-needed -ldl -Wl,--no-as-needed
LDFLAGS_apk += -L$(obj)
LDFLAGS_apk-test += -L$(obj)
CFLAGS_ALL += $(OPENSSL_CFLAGS) $(ZLIB_CFLAGS) $(SODIUM_CFLAGS)
LIBS := -Wl,--as-needed \
$(OPENSSL_LIBS) $(ZLIB_LIBS) $(SODIUM_LIBS) \
-Wl,--no-as-needed
add script to autogenerate help from man pages This creates main help like: -- usage: apk [<OPTIONS>...] COMMAND [<ARGUMENTS>...] Package installation and removal: add Add packages to WORLD and commit changes del Remove packages from WORLD and commit changes System maintenance: fix Check WORLD against the system and ensure consistency update Update repository indexes upgrade Install upgrades available from repositories cache Commands related to the management of an offline package cache Querying package information: info Give detailed information about packages or repositories list List packages matching a pattern or other criteria dot Generate graphviz graphs policy Show repository policy for packages Repository maintenance: index Create repository index file from packages fetch Download packages from global repositories to a local directory manifest Show checksums of package contents verify Verify package integrity and signature Miscellaneous: audit Audit directories for changes stats Show statistics about repositories and installations version Compare package versions or perform tests on version strings This apk has coffee making abilities. -- And applet specific help like: -- usage: apk add [<OPTIONS>...] PACKAGES... Description: apk add adds the requested packages to WORLD and installs (or upgrades) them if not already present, ensuring all dependencies are met. Options: --initdb Initialize a new package database -l, --latest Disables normal heuristics for choosing which repository to install a -u, --upgrade When adding packages which are already installed, upgrade them rather -t, --virtual NAME Instead of adding the specified packages to WORLD, create a new --no-chown Do not change file owner or group --
2020-04-24 08:49:14 +00:00
# Help generation
quiet_cmd_genhelp = GENHELP $@
ifneq ($(LUA),no)
add script to autogenerate help from man pages This creates main help like: -- usage: apk [<OPTIONS>...] COMMAND [<ARGUMENTS>...] Package installation and removal: add Add packages to WORLD and commit changes del Remove packages from WORLD and commit changes System maintenance: fix Check WORLD against the system and ensure consistency update Update repository indexes upgrade Install upgrades available from repositories cache Commands related to the management of an offline package cache Querying package information: info Give detailed information about packages or repositories list List packages matching a pattern or other criteria dot Generate graphviz graphs policy Show repository policy for packages Repository maintenance: index Create repository index file from packages fetch Download packages from global repositories to a local directory manifest Show checksums of package contents verify Verify package integrity and signature Miscellaneous: audit Audit directories for changes stats Show statistics about repositories and installations version Compare package versions or perform tests on version strings This apk has coffee making abilities. -- And applet specific help like: -- usage: apk add [<OPTIONS>...] PACKAGES... Description: apk add adds the requested packages to WORLD and installs (or upgrades) them if not already present, ensuring all dependencies are met. Options: --initdb Initialize a new package database -l, --latest Disables normal heuristics for choosing which repository to install a -u, --upgrade When adding packages which are already installed, upgrade them rather -t, --virtual NAME Instead of adding the specified packages to WORLD, create a new --no-chown Do not change file owner or group --
2020-04-24 08:49:14 +00:00
cmd_genhelp = $(LUA) $(src)/genhelp.lua $(filter %.scd, $^) > $@
else
cmd_genhelp = echo \\\#define NO_HELP > $@
endif
add script to autogenerate help from man pages This creates main help like: -- usage: apk [<OPTIONS>...] COMMAND [<ARGUMENTS>...] Package installation and removal: add Add packages to WORLD and commit changes del Remove packages from WORLD and commit changes System maintenance: fix Check WORLD against the system and ensure consistency update Update repository indexes upgrade Install upgrades available from repositories cache Commands related to the management of an offline package cache Querying package information: info Give detailed information about packages or repositories list List packages matching a pattern or other criteria dot Generate graphviz graphs policy Show repository policy for packages Repository maintenance: index Create repository index file from packages fetch Download packages from global repositories to a local directory manifest Show checksums of package contents verify Verify package integrity and signature Miscellaneous: audit Audit directories for changes stats Show statistics about repositories and installations version Compare package versions or perform tests on version strings This apk has coffee making abilities. -- And applet specific help like: -- usage: apk add [<OPTIONS>...] PACKAGES... Description: apk add adds the requested packages to WORLD and installs (or upgrades) them if not already present, ensuring all dependencies are met. Options: --initdb Initialize a new package database -l, --latest Disables normal heuristics for choosing which repository to install a -u, --upgrade When adding packages which are already installed, upgrade them rather -t, --virtual NAME Instead of adding the specified packages to WORLD, create a new --no-chown Do not change file owner or group --
2020-04-24 08:49:14 +00:00
$(obj)/help.h: $(src)/genhelp.lua $(wildcard doc/apk*.8.scd) FORCE
$(call if_changed,genhelp)
add script to autogenerate help from man pages This creates main help like: -- usage: apk [<OPTIONS>...] COMMAND [<ARGUMENTS>...] Package installation and removal: add Add packages to WORLD and commit changes del Remove packages from WORLD and commit changes System maintenance: fix Check WORLD against the system and ensure consistency update Update repository indexes upgrade Install upgrades available from repositories cache Commands related to the management of an offline package cache Querying package information: info Give detailed information about packages or repositories list List packages matching a pattern or other criteria dot Generate graphviz graphs policy Show repository policy for packages Repository maintenance: index Create repository index file from packages fetch Download packages from global repositories to a local directory manifest Show checksums of package contents verify Verify package integrity and signature Miscellaneous: audit Audit directories for changes stats Show statistics about repositories and installations version Compare package versions or perform tests on version strings This apk has coffee making abilities. -- And applet specific help like: -- usage: apk add [<OPTIONS>...] PACKAGES... Description: apk add adds the requested packages to WORLD and installs (or upgrades) them if not already present, ensuring all dependencies are met. Options: --initdb Initialize a new package database -l, --latest Disables normal heuristics for choosing which repository to install a -u, --upgrade When adding packages which are already installed, upgrade them rather -t, --virtual NAME Instead of adding the specified packages to WORLD, create a new --no-chown Do not change file owner or group --
2020-04-24 08:49:14 +00:00
CFLAGS_help.o := -I$(obj)
generate-y += help.h
# Test build
ifeq ($(TEST),y)
progs-y += apk-test
apk-test-objs := apk-test.o $(filter-out apk.o, $(apk-objs))
endif
$(obj)/apk: $(libapk_so)
$(obj)/apk-test: $(libapk_so)
$(obj)/apk.so: $(libapk_so)
generate-y += libapk.so
$(obj)/libapk.so:
$(LN) libapk.so.$(libapk_soname) $(obj)/libapk.so
2010-03-05 08:13:25 +00:00
generate-y += apk.pc
2010-03-06 19:07:38 +00:00
install: $(obj)/apk $(libapk_so) $(libapk_a) $(apklua_so)
$(INSTALLDIR) $(DESTDIR)$(SBINDIR)
$(INSTALL) $(obj)/apk $(DESTDIR)$(SBINDIR)
$(install-libapk_so)
$(install-libapk_a)
$(install-apklua_so)
$(INSTALLDIR) $(DESTDIR)$(INCLUDEDIR)/apk
$(INSTALL) -m644 src/apk_*.h $(DESTDIR)$(INCLUDEDIR)/apk
$(INSTALL) -m644 src/help.h $(DESTDIR)$(INCLUDEDIR)/apk
$(INSTALLDIR) $(DESTDIR)$(PKGCONFIGDIR)
$(INSTALL) -m644 $(obj)/apk.pc $(DESTDIR)$(PKGCONFIGDIR)
2010-03-05 08:13:25 +00:00