2009-08-17 22:37:20 +05:30
|
|
|
include ../vars.mk
|
|
|
|
|
2010-01-19 01:48:26 +05:30
|
|
|
LIBXBPS_MAJOR = 0
|
|
|
|
LIBXBPS_MINOR = 0
|
|
|
|
LIBXBPS_MICRO = 0
|
|
|
|
LIBXBPS_SHLIB = libxbps.so.$(LIBXBPS_MAJOR).$(LIBXBPS_MINOR).$(LIBXBPS_MICRO)
|
2010-01-06 15:45:56 +05:30
|
|
|
LDFLAGS += -lprop -larchive -lssl
|
2010-01-19 01:48:26 +05:30
|
|
|
LDFLAGS += -shared -Wl,-soname,libxbps.so.$(LIBXBPS_MAJOR)
|
2009-10-27 06:16:00 +05:30
|
|
|
|
|
|
|
# libfetch
|
2010-01-19 01:48:26 +05:30
|
|
|
LIBFETCH_OBJS = fetch/common.o fetch/fetch.o fetch/file.o
|
|
|
|
LIBFETCH_OBJS += fetch/ftp.o fetch/http.o
|
|
|
|
LIBFETCH_CPPFLAGS = -DFTP_COMBINE_CWDS -DNETBSD -DINET6 -DWITH_SSL
|
|
|
|
LIBFETCH_CFLAGS = -Wno-unused-macros -Wno-conversion -Wno-stack-protector
|
2010-01-21 07:40:19 +05:30
|
|
|
LIBFETCH_SHLIBCFLAGS = -fvisibility=hidden
|
2010-01-19 01:48:26 +05:30
|
|
|
LIBFETCH_INCS = fetch/common.h
|
|
|
|
LIBFETCH_GEN = fetch/ftperr.h fetch/httperr.h
|
2009-10-27 06:16:00 +05:30
|
|
|
|
|
|
|
# libxbps
|
2010-01-19 01:48:26 +05:30
|
|
|
OBJS = configure.o config_files.o cmpver.o download.o fexec.o
|
2009-11-30 16:08:14 +05:30
|
|
|
OBJS += humanize_number.o orphans.o plist.o purge.o register.o
|
|
|
|
OBJS += regpkgs_dictionary.o remove.o remove_obsoletes.o repository.o
|
|
|
|
OBJS += repository_finddeps.o repository_findpkg.o repository_plist.o
|
2009-11-30 16:23:25 +05:30
|
|
|
OBJS += repository_pool.o repository_sync_index.o requiredby.o sha256.o
|
|
|
|
OBJS += sortdeps.o state.o unpack.o util.o pkgmatch.o mkpath.o
|
2009-10-27 06:16:00 +05:30
|
|
|
|
2009-11-18 14:35:45 +05:30
|
|
|
.PHONY: all
|
2010-01-19 01:48:26 +05:30
|
|
|
all: libxbps.so libxbps.a
|
2009-08-17 22:37:20 +05:30
|
|
|
|
2010-01-19 01:48:26 +05:30
|
|
|
fetch/ftperr.h: fetch/ftp.errors
|
|
|
|
@echo " [GEN]\t\t$@"
|
|
|
|
@./fetch/errlist.sh ftp_errlist FTP $< > $@
|
2009-10-27 06:16:00 +05:30
|
|
|
|
2010-01-19 01:48:26 +05:30
|
|
|
fetch/httperr.h: fetch/http.errors
|
|
|
|
@echo " [GEN]\t\t$@"
|
|
|
|
@./fetch/errlist.sh http_errlist HTTP $< > $@
|
|
|
|
|
|
|
|
$(LIBFETCH_OBJS): %.o: %.c $(LIBFETCH_INCS) $(LIBFETCH_GEN)
|
|
|
|
@echo " [CC]\t\t$@"
|
|
|
|
@$(CC) $(CPPFLAGS) $(LIBFETCH_CPPFLAGS) $(CFLAGS) \
|
2010-01-21 07:40:19 +05:30
|
|
|
$(LIBFETCH_CFLAGS) $(LIBFETCH_SHLIBCFLAGS) -c $< -o $@
|
2010-01-19 01:48:26 +05:30
|
|
|
|
|
|
|
$(OBJS): %.o: %.c
|
|
|
|
@echo " [CC]\t\t$@"
|
|
|
|
@$(CC) $(CPPFLAGS) $(CFLAGS) $(SHAREDLIB_CFLAGS) -c $< -o $@
|
2009-10-30 16:47:26 +05:30
|
|
|
|
2009-11-18 14:35:45 +05:30
|
|
|
libxbps.so: $(OBJS) $(LIBFETCH_OBJS)
|
2010-01-19 01:48:26 +05:30
|
|
|
@echo " [CCLD]\t\t$@"
|
2010-01-06 15:45:56 +05:30
|
|
|
@$(CC) $(LDFLAGS) $^ -o $(LIBXBPS_SHLIB)
|
2010-01-19 01:48:26 +05:30
|
|
|
@-ln -sf $(LIBXBPS_SHLIB) libxbps.so.$(LIBXBPS_MAJOR)
|
2009-11-19 10:33:37 +05:30
|
|
|
@-ln -sf $(LIBXBPS_SHLIB) libxbps.so
|
2009-08-17 22:37:20 +05:30
|
|
|
|
2009-11-18 14:35:45 +05:30
|
|
|
libxbps.a: $(OBJS) $(LIBFETCH_OBJS)
|
2010-01-19 01:48:26 +05:30
|
|
|
@echo " [AR]\t\t$@"
|
2009-11-19 10:33:37 +05:30
|
|
|
@$(AR) rcs $@ $^
|
2010-01-19 01:48:26 +05:30
|
|
|
@echo " [RANLIB]\t$@"
|
2009-11-19 10:33:37 +05:30
|
|
|
@ranlib $@
|
2009-08-17 22:37:20 +05:30
|
|
|
|
2009-08-21 14:47:58 +05:30
|
|
|
.PHONY: install
|
2009-10-27 06:16:00 +05:30
|
|
|
install: all
|
2009-08-17 22:37:20 +05:30
|
|
|
install -d $(LIBDIR)
|
2009-10-27 06:16:00 +05:30
|
|
|
install -m 644 libxbps.a $(LIBDIR)
|
2010-01-13 21:27:21 +05:30
|
|
|
install -m 755 $(LIBXBPS_SHLIB) $(LIBDIR)
|
2009-10-27 06:16:00 +05:30
|
|
|
cp -a libxbps.so $(LIBDIR)
|
2010-01-19 01:48:26 +05:30
|
|
|
cp -a libxbps.so.$(LIBXBPS_MAJOR) $(LIBDIR)
|
2009-08-17 22:37:20 +05:30
|
|
|
|
2009-10-18 14:45:39 +05:30
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
|
|
|
-rm -f $(LIBDIR)/libxbps.*
|
|
|
|
|
2009-08-17 22:37:20 +05:30
|
|
|
.PHONY: clean
|
2009-10-27 06:16:00 +05:30
|
|
|
clean:
|
2010-01-19 01:48:26 +05:30
|
|
|
-rm -f libxbps* $(OBJS) $(LIBFETCH_OBJS)
|
|
|
|
-rm -f $(LIBFETCH_GEN)
|