From 5b6724b550c96ec002da309fddc81e1b20cadc4e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 30 Oct 2009 17:23:45 +0100 Subject: [PATCH] Fix up some issues for building shared/static bins. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091030162345-2so2ejfvvqr29s7v --- Makefile | 24 +++--------------------- lib/Makefile | 2 ++ prog.mk | 2 ++ 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 85059973..483b8784 100644 --- a/Makefile +++ b/Makefile @@ -4,27 +4,9 @@ SUBDIRS = lib bin .PHONY: all all: - @echo - @echo "********************************" - @echo "*** Building shared libxbps ***" - @echo "********************************" - @echo - $(MAKE) -C lib - @echo - @echo "********************************" - @echo "*** Building shared binaries ***" - @echo "********************************" - @echo - $(MAKE) -C bin - @echo - @echo "********************************" - @echo "*** Building static binaries ***" - @echo "********************************" - @echo - $(MAKE) -C lib clean - $(MAKE) -C bin clean - $(MAKE) STATIC=1 -C lib - $(MAKE) STATIC=1 -C bin + for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir; \ + done .PHONY: install install: diff --git a/lib/Makefile b/lib/Makefile index c5038555..7d670f3d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -44,7 +44,9 @@ libxbps.a: $(OBJS) .PHONY: install install: all install -d $(LIBDIR) +ifdef STATIC install -m 644 libxbps.a $(LIBDIR) +endif install -m 644 $(LIBXBPS_SHLIB) $(LIBDIR) cp -a libxbps.so $(LIBDIR) cp -a libxbps.so.$(LIBMAJOR) $(LIBDIR) diff --git a/prog.mk b/prog.mk index 6b570d2d..3891d786 100644 --- a/prog.mk +++ b/prog.mk @@ -29,7 +29,9 @@ clean: install: $(BIN) $(MAN) install -d $(SBINDIR) install $(INSTALL_STRIPPED) -m 755 $(BIN) $(SBINDIR) +ifdef STATIC install $(INSTALL_STRIPPED) -m 755 $(BIN).static $(SBINDIR) +endif ifdef MAN install -d $(MANDIR) install -m 644 $(MAN) $(MANDIR)