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

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

19
20
21
22
CFLAGS			+= $(shell pkg-config --cflags $(PKGDEPS))
LIBS			:= -Wl,--as-needed \
				$(shell pkg-config --libs $(PKGDEPS)) \
			   -Wl,--no-as-needed
23
24
25

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