Makefile 709 Bytes
Newer Older
Timo Teräs's avatar
Timo Teräs committed
1 2 3 4 5 6
PKGDEPS := openssl

ifeq ($(shell pkg-config --print-errors --exists $(PKGDEPS) || echo fail),fail)
$(error Build dependencies are not met)
endif

7 8
progs-y			+= apk
apk-objs		:= state.o database.o package.o archive.o \
Timo Teräs's avatar
Timo Teräs committed
9
			   version.o io.o url.o gunzip.o blob.o hash.o apk.o \
Timo Teräs's avatar
Timo Teräs committed
10
			   add.o del.o update.o info.o search.o upgrade.o \
Timo Teräs's avatar
Timo Teräs committed
11
			   cache.o ver.o index.o fetch.o audit.o
12
CFLAGS_apk.o		:= -DAPK_VERSION=\"$(FULL_VERSION)\"
13

14 15 16
progs-$(STATIC)		+= apk.static
apk.static-objs		:= $(apk-objs)
LDFLAGS_apk.static	:= -static
17
LDFLAGS_apk		+= -nopie
18

Timo Teräs's avatar
Timo Teräs committed
19 20
LIBS			+= $(shell pkg-config --libs $(PKGDEPS))
LIBS			+= /usr/lib/libz.a
21 22 23

install::
	$(INSTALLDIR) $(DESTDIR)$(SBINDIR)
24
	$(INSTALL) $(obj)/apk $(DESTDIR)$(SBINDIR)