2008-12-21 23:57:02 +01:00
|
|
|
include ../vars.mk
|
|
|
|
|
|
|
|
# The shared library.
|
|
|
|
MAJOR = 0
|
|
|
|
MINOR = 0
|
|
|
|
MICRO = 0
|
|
|
|
LIBXBPS_SO = $(LIBXBPS).$(MAJOR).$(MINOR).$(MICRO)
|
|
|
|
LIBXBPS = libxbps.so
|
2009-04-10 17:09:12 +02:00
|
|
|
LIBXBPS_STATIC = libxbps.a
|
2008-12-23 12:28:21 +01:00
|
|
|
LIBXBPS_LDFLAGS = -larchive -lprop -shared -Wl,-soname,$(LIBXBPS).$(MAJOR)
|
|
|
|
|
2009-08-08 22:29:48 +02:00
|
|
|
OBJECTS = configure.o cmpver.o depends.o fexec.o findpkg.o
|
|
|
|
OBJECTS += humanize_number.o orphans.o plist.o register.o remove.o
|
2009-08-08 22:56:08 +02:00
|
|
|
OBJECTS += repository.o requiredby.o sha256.o sortdeps.o state.o
|
2009-08-08 22:29:48 +02:00
|
|
|
OBJECTS += unpack.o util.o
|
2008-12-21 23:57:02 +01:00
|
|
|
|
2009-04-10 17:09:12 +02:00
|
|
|
all: $(LIBXBPS) $(LIBXBPS_STATIC)
|
2008-12-21 23:57:02 +01:00
|
|
|
.PHONY: all
|
|
|
|
|
2008-12-23 12:28:21 +01:00
|
|
|
$(LIBXBPS): $(OBJECTS)
|
2008-12-21 23:57:02 +01:00
|
|
|
$(CC) $(LIBXBPS_LDFLAGS) $^ -o $(LIBXBPS_SO)
|
|
|
|
-ln -sf $(LIBXBPS_SO) $(LIBXBPS).$(MAJOR)
|
|
|
|
-ln -sf $(LIBXBPS_SO) $(LIBXBPS)
|
|
|
|
|
2009-04-10 17:09:12 +02:00
|
|
|
$(LIBXBPS_STATIC): $(OBJECTS)
|
|
|
|
$(AR) rcs $@ $^
|
2009-04-10 19:09:13 +02:00
|
|
|
ranlib $@
|
2009-04-10 17:09:12 +02:00
|
|
|
|
2009-04-10 18:37:41 +02:00
|
|
|
install: $(LIBXBPS) $(LIBXBPS_STATIC)
|
2008-12-22 02:14:40 +01:00
|
|
|
install -d $(LIBDIR)
|
2009-04-10 17:09:12 +02:00
|
|
|
install -m 644 $(LIBXBPS_STATIC) $(LIBDIR)
|
2008-12-22 02:14:40 +01:00
|
|
|
install -m 644 $(LIBXBPS_SO) $(LIBDIR)
|
2009-02-16 02:26:27 +01:00
|
|
|
cp -a $(LIBXBPS) $(LIBDIR)
|
|
|
|
cp -a $(LIBXBPS).$(MAJOR) $(LIBDIR)
|
2008-12-22 02:14:40 +01:00
|
|
|
|
2008-12-21 23:57:02 +01:00
|
|
|
.PHONY: clean
|
|
|
|
clean: clean-lib clean-objs
|
|
|
|
|
|
|
|
clean-lib:
|
|
|
|
-rm -f $(LIBXBPS)*
|
2009-04-10 17:09:12 +02:00
|
|
|
-rm -f $(LIBXBPS_STATIC)
|
2008-12-21 23:57:02 +01:00
|
|
|
|
|
|
|
clean-objs:
|
|
|
|
-rm -f *.o
|