diff --git a/lib/Makefile b/lib/Makefile index 8d52c6f4a..34a82a449 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -51,8 +51,13 @@ OBJS += conf.o log.o OBJS += $(EXTOBJS) $(COMPAT_OBJS) # unnecessary unless pkgdb format changes # OBJS += pkgdb_conversion.o + .PHONY: all -all: libxbps.so libxbps.a +ifdef BUILD_STATIC +all: libxbps.a +else +all: libxbps.so +endif external/fetch/ftperr.h: external/fetch/ftp.errors @printf " [GEN]\t\t$@\n" @@ -92,9 +97,11 @@ libxbps.a: $(LIBFETCH_OBJS) $(LIBPROP_OBJS) $(OBJS) install: all install -d $(DESTDIR)$(LIBDIR) install -m 644 libxbps.a $(DESTDIR)$(LIBDIR) +ifndef BUILD_STATIC install -m 755 $(LIBXBPS_SHLIB) $(DESTDIR)$(LIBDIR) cp -a libxbps.so $(DESTDIR)$(LIBDIR) cp -a libxbps.so.$(LIBXBPS_MAJOR) $(DESTDIR)$(LIBDIR) +endif .PHONY: uninstall uninstall: diff --git a/mk/prog.mk b/mk/prog.mk index 82ba82b50..55ba6c206 100644 --- a/mk/prog.mk +++ b/mk/prog.mk @@ -7,7 +7,7 @@ MANSECTION ?= 1 MAN ?= $(BIN).$(MANSECTION) ifdef BUILD_STATIC -BINS += $(BIN).static +BINS = $(BIN).static endif CFLAGS += -Wno-unused-command-line-argument @@ -23,10 +23,7 @@ clean: .PHONY: install install: all install -d $(DESTDIR)$(SBINDIR) - install -m 755 $(BIN) $(DESTDIR)$(SBINDIR) -ifdef BUILD_STATIC - install -m 755 $(BIN).static $(DESTDIR)$(SBINDIR) -endif + install -m 755 $(BINS) $(DESTDIR)$(SBINDIR) ifdef MAN install -d $(DESTDIR)$(MANDIR)/man$(MANSECTION) install -m 644 $(MAN) $(DESTDIR)$(MANDIR)/man$(MANSECTION) @@ -34,10 +31,7 @@ endif .PHONY: uninstall uninstall: - -rm -f $(DESTDIR)$(SBINDIR)/$(BIN) -ifdef BUILD_STATIC - -rm -f $(DESTDIR)$(SBINDIR)/$(BIN).static -endif + -rm -f $(DESTDIR)$(SBINDIR)/$(BINS) ifdef MAN -rm -f $(DESTDIR)$(MANDIR)/man$(MANSECTION)/$(MAN) endif