adbd3d727c
dependencies, as specified in blueprint "improved-version-matching". It's possible now to require greater, greater or equal than, less, less or equal than, and equal pkg versions, as well as using '{}' and '[^!]' csh patterns in dependencies. Code lifted from FreeBSD, thanks! :-) Change XBPS_RELVER to 20091107 to match latest additions. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091107035620-3051wcwrirqn2g14
63 lines
1.3 KiB
Makefile
63 lines
1.3 KiB
Makefile
include ../vars.mk
|
|
|
|
LIBMAJOR = 0
|
|
LIBMINOR = 0
|
|
LIBMICRO = 0
|
|
LIBXBPS_SHLIB = libxbps.so.$(LIBMAJOR).$(LIBMINOR).$(LIBMICRO)
|
|
LIBXBPS_LDFLAGS = -shared -Wl,-soname,libxbps.so.$(LIBMAJOR)
|
|
|
|
# libfetch
|
|
OBJS = fetch/common.o fetch/fetch.o fetch/file.o fetch/ftp.o fetch/http.o
|
|
|
|
# libxbps
|
|
OBJS += configure.o cmpver.o depends.o download.o fexec.o findpkg.o
|
|
OBJS += humanize_number.o orphans.o plist.o purge.o register.o remove.o
|
|
OBJS += repository.o requiredby.o sha256.o sortdeps.o state.o
|
|
OBJS += sync_remote_pkgidx.o unpack.o util.o pkgmatch.o
|
|
|
|
ifdef STATIC
|
|
all: libfetch libxbps.a
|
|
else
|
|
LDFLAGS = -lprop -larchive
|
|
ifdef WITH_SSL
|
|
LDFLAGS += -lssl -lcrypto
|
|
endif
|
|
all: libfetch libxbps.so libxbps.a
|
|
endif
|
|
.PHONY: all
|
|
|
|
libfetch:
|
|
$(MAKE) -C fetch
|
|
|
|
%.o: %.c
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $<
|
|
|
|
libxbps.so: $(OBJS)
|
|
$(CC) $(LDFLAGS) $(LIBXBPS_LDFLAGS) $^ -o $(LIBXBPS_SHLIB)
|
|
-ln -sf $(LIBXBPS_SHLIB) libxbps.so.$(LIBMAJOR)
|
|
-ln -sf $(LIBXBPS_SHLIB) libxbps.so
|
|
|
|
libxbps.a: $(OBJS)
|
|
$(AR) rcs $@ $^
|
|
ranlib $@
|
|
|
|
.PHONY: install
|
|
install: all
|
|
install -d $(LIBDIR)
|
|
ifdef STATIC
|
|
install -m 644 libxbps.a $(LIBDIR)
|
|
else
|
|
install -m 644 $(LIBXBPS_SHLIB) $(LIBDIR)
|
|
cp -a libxbps.so $(LIBDIR)
|
|
cp -a libxbps.so.$(LIBMAJOR) $(LIBDIR)
|
|
endif
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
-rm -f $(LIBDIR)/libxbps.*
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
-rm -f libxbps* $(OBJS)
|
|
$(MAKE) -C fetch clean
|