summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-03-05 08:13:25 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-06-11 07:02:18 +0000
commit3ec82a5a420fc00d38ad7dded819525a91533652 (patch)
tree84016128e65001e4aed1d45a1402b2fb2375c385 /src/Makefile
parent60b537e356dfcd0ed9a3516152c6a170912efcef (diff)
downloadapk-tools-3ec82a5a420fc00d38ad7dded819525a91533652.tar.gz
apk-tools-3ec82a5a420fc00d38ad7dded819525a91533652.tar.bz2
apk-tools-3ec82a5a420fc00d38ad7dded819525a91533652.tar.xz
apk-tools-3ec82a5a420fc00d38ad7dded819525a91533652.zip
First steps for libapk
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/Makefile b/src/Makefile
index 0f60fa9..b0b2a67 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,24 +4,34 @@ ifeq ($(shell pkg-config --print-errors --exists $(PKGDEPS) || echo fail),fail)
$(error Build dependencies are not met)
endif
+shlibs-y += libapk.so
+libapk.so-objs := common.o state.o database.o package.o archive.o \
+ version.o io.o url.o gunzip.o blob.o hash.o print.o
+
progs-y += apk
-apk-objs := common.o state.o database.o package.o archive.o \
- version.o io.o url.o gunzip.o blob.o hash.o apk.o \
- add.o del.o fix.o update.o info.o search.o upgrade.o \
- cache.o ver.o index.o fetch.o audit.o verify.o
+apk-objs := apk.o add.o del.o fix.o update.o info.o \
+ search.o upgrade.o cache.o ver.o index.o fetch.o \
+ audit.o verify.o
+
CFLAGS += -D_ATFILE_SOURCE
CFLAGS_apk.o := -DAPK_VERSION=\"$(FULL_VERSION)\"
+LIBS_apk := -lapk
progs-$(STATIC) += apk.static
apk.static-objs := $(apk-objs)
LDFLAGS_apk.static := -static
-LDFLAGS_apk += -nopie
+LDFLAGS_apk += -nopie -L$(obj)
CFLAGS += $(shell pkg-config --cflags $(PKGDEPS))
LIBS := -Wl,--as-needed \
$(shell pkg-config --libs $(PKGDEPS)) \
-Wl,--no-as-needed
-install:
- $(INSTALLDIR) $(DESTDIR)$(SBINDIR)
+
+$(obj)/apk: $(obj)/libapk.so
+
+install: $(obj)/apk $(obj)/libapk.so
+ $(INSTALLDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR)
$(INSTALL) $(obj)/apk $(DESTDIR)$(SBINDIR)
+ $(INSTALL) $(obj)/libapk.so $(DESTDIR)$(LIBDIR)
+