utils/Makefile: build the libxbps shared lib.

--HG--
extra : convert_revision : 8584a398b2ba51e841744c25be8a8b16e0736d7e
This commit is contained in:
Juan RP 2008-12-21 22:00:33 +01:00
parent d14b2332b5
commit 4053dc4789

View file

@ -1,33 +1,46 @@
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
CFLAGS += -Wall -Werror -O3 -I$(PREFIX)/include
CFLAGS += -funroll-all-loops -ftree-loop-linear
LDFLAGS += -lprop
CFLAGS += -funroll-all-loops -ftree-loop-linear -fPIC -DPIC
LDFLAGS += -L $$(pwd) -Wl,-rpath $$(pwd) -lxbps
BINS ?= xbps-bin xbps-cmpver xbps-digest xbps-pkgdb
all: $(BINS)
# The shared library.
MAJOR = 0
MINOR = 0
MICRO = 0
LIBXBPS_SO = $(LIBXBPS).$(MAJOR).$(MINOR).$(MICRO)
LIBXBPS = libxbps.so
LIBXBPS_LDFLAGS = -lprop -shared -Wl,-soname,$(LIBXBPS).$(MAJOR)
all: $(LIBXBPS_NAME) $(BINS)
.PHONY: all
xbps-bin: xbps-bin.o plist.o
$(LIBXBPS): sha256.o plist.o
$(CC) $(LIBXBPS_LDFLAGS) $^ -o $(LIBXBPS_SO)
-ln -sf $(LIBXBPS_SO) $(LIBXBPS).$(MAJOR)
-ln -sf $(LIBXBPS_SO) $(LIBXBPS)
xbps-bin: xbps-bin.o $(LIBXBPS)
$(CC) $(LDFLAGS) $^ -o $@
xbps-cmpver: xbps-cmpver.o
$(CC) $^ -o $@
xbps-digest: xbps-digest.o sha256.o
$(CC) $^ -o $@
xbps-digest: xbps-digest.o $(LIBXBPS)
$(CC) $(LDFLAGS) $^ -o $@
xbps-pkgdb: xbps-pkgdb.o plist.o
xbps-pkgdb: xbps-pkgdb.o $(LIBXBPS)
$(CC) $(LDFLAGS) $^ -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BINS)
-rm -f $(BINS) $(LIBXBPS)*
clean-objs:
-rm -f *.o
-rm -f *.o $(LIBXBPS)*
install: $(BINS)
install -D $(BINS) $(BINDIR)