vp-build/lib/Makefile
Juan RP 0d04547576 Add the concept of purging a package, such as with dpkg.
By default a package when is removed, its configuration files
and metadata files won't be removed unless the package is purged.

While here add two targets for xbps-bin:

 * purge [<pkgname>|<all>], passing the "all" string (case insensitive)
   will purge all packages that are in this state (XBPS_PKG_STATE_CONFIG_FILES).

 * reconfigure [<pkgname>|<all>], reconfigures a package or "all"
   if package hasn't been configured. Passing -f reconfigures it again
   even if it's state is ok.

--HG--
extra : convert_revision : bd2d3913ca087a0565b05fa9ee3f9b6d5e3cb934
2009-08-13 16:46:20 +02:00

45 lines
1.0 KiB
Makefile

include ../vars.mk
# The shared library.
MAJOR = 0
MINOR = 0
MICRO = 0
LIBXBPS_SO = $(LIBXBPS).$(MAJOR).$(MINOR).$(MICRO)
LIBXBPS = libxbps.so
LIBXBPS_STATIC = libxbps.a
LIBXBPS_LDFLAGS = -larchive -lprop -shared -Wl,-soname,$(LIBXBPS).$(MAJOR)
OBJECTS = configure.o cmpver.o depends.o fexec.o findpkg.o
OBJECTS += humanize_number.o orphans.o plist.o purge.o register.o remove.o
OBJECTS += repository.o requiredby.o sha256.o sortdeps.o state.o unpack.o
OBJECTS += util.o
all: $(LIBXBPS) $(LIBXBPS_STATIC)
.PHONY: all
$(LIBXBPS): $(OBJECTS)
$(CC) $(LIBXBPS_LDFLAGS) $^ -o $(LIBXBPS_SO)
-ln -sf $(LIBXBPS_SO) $(LIBXBPS).$(MAJOR)
-ln -sf $(LIBXBPS_SO) $(LIBXBPS)
$(LIBXBPS_STATIC): $(OBJECTS)
$(AR) rcs $@ $^
ranlib $@
install: $(LIBXBPS) $(LIBXBPS_STATIC)
install -d $(LIBDIR)
install -m 644 $(LIBXBPS_STATIC) $(LIBDIR)
install -m 644 $(LIBXBPS_SO) $(LIBDIR)
cp -a $(LIBXBPS) $(LIBDIR)
cp -a $(LIBXBPS).$(MAJOR) $(LIBDIR)
.PHONY: clean
clean: clean-lib clean-objs
clean-lib:
-rm -f $(LIBXBPS)*
-rm -f $(LIBXBPS_STATIC)
clean-objs:
-rm -f *.o