summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-05-05 15:29:42 -0400
committermidipix <writeonce@midipix.org>2016-05-05 20:56:37 -0400
commit32003e663b3feefd73d2bc4a4e9f87e4eab7ec7f (patch)
tree1695f26a8de2b696f334dd133e405b4fba894e61
parent36a4c5f608ab93fed5f3c48ef175e8eeb49e7b18 (diff)
downloadslibtool-32003e663b3feefd73d2bc4a4e9f87e4eab7ec7f.tar.bz2
slibtool-32003e663b3feefd73d2bc4a4e9f87e4eab7ec7f.tar.xz
build system: Makefile.in, custom.mk: added --all-[static|shared] support.
-rw-r--r--Makefile.in18
-rw-r--r--project/custom.mk24
2 files changed, 37 insertions, 5 deletions
diff --git a/Makefile.in b/Makefile.in
index 5739b0f..5a02d0f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -104,8 +104,13 @@ all: shared static app
install: install-libs install-headers install-app install-extras
-app: default-app
+app: package-app app-tag
+app-tag: package-app app.tag
+
+app.tag: package-app
+ cp $(PACKAGE_APP) $(APP)
+ touch app.tag
install-libs: install-shared install-static install-libs-extras
@@ -147,11 +152,11 @@ static-lib: static-objs $(STATIC_LIB)
-default-app: version.tag static $(DEFAULT_APP) $(APP)
+default-app: version.tag static-objs $(DEFAULT_APP)
shared-app: version.tag shared $(SHARED_APP)
-static-app: version.tag static $(STATIC_APP)
+static-app: version.tag static-objs $(STATIC_APP)
@@ -167,16 +172,18 @@ $(SHARED_LIB): $(SHARED_OBJS)
$(STATIC_LIB): $(STATIC_OBJS)
-$(APP): $(DEFAULT_APP)
- cp $^ $@
+$(APP): $(PACKAGE_APP)
$(DEFAULT_APP): $(STATIC_OBJS) $(APP_OBJS)
+ rm -f app.tag
$(CC) -o $@ $^ $(LDFLAGS_APP)
$(SHARED_APP): $(SHARED_LIB) $(APP_OBJS)
+ rm -f app.tag
$(CC) -o $@ $(APP_OBJS) -l$(PACKAGE) $(LDFLAGS_SHARED)
$(STATIC_APP): $(STATIC_OBJS) $(APP_OBJS)
+ rm -f app.tag
$(CC) -static -o $@ $^ -l$(PACKAGE) $(LDFLAGS_STATIC)
@@ -322,6 +329,7 @@ clean: clean-implib
.PHONY: all install shared static app .display \
+ package-app \
shared-objs shared-lib \
static-objs static-lib \
default-app shared-app static-app \
diff --git a/project/custom.mk b/project/custom.mk
index 16ff41d..e58f88c 100644
--- a/project/custom.mk
+++ b/project/custom.mk
@@ -5,3 +5,27 @@ endif
ifeq ($(OS_BINFMT),ELF)
include $(PROJECT_DIR)/sysinfo/os/elf.mk
endif
+
+
+
+ifeq ($(ALL_STATIC),yes)
+
+package-app: static-app
+app: PACKAGE_APP = $(STATIC_APP)
+app-tag: PACKAGE_APP = $(STATIC_APP)
+
+
+else ifeq ($(ALL_SHARED),yes)
+
+package-app: shared-app
+app: PACKAGE_APP = $(SHARED_APP)
+app-tag: PACKAGE_APP = $(SHARED_APP)
+
+
+else
+
+package-app: default-app
+app: PACKAGE_APP = $(DEFAULT_APP)
+app-tag: PACKAGE_APP = $(DEFAULT_APP)
+
+endif