Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: don't build or install shared objects when doing a static build. #354

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ OBJS += conf.o log.o
OBJS += $(EXTOBJS) $(COMPAT_OBJS)
# unnecessary unless pkgdb format changes
# OBJS += pkgdb_conversion.o

.PHONY: all
ifdef BUILD_STATIC
all: libxbps.a
else
all: libxbps.so libxbps.a
endif

external/fetch/ftperr.h: external/fetch/ftp.errors
@printf " [GEN]\t\t$@\n"
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 3 additions & 9 deletions mk/prog.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,21 +23,15 @@ 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)
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
Expand Down