diff --git a/Makefile b/Makefile index e1836e58..b6c65571 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ include vars.mk -SUBDIRS = lib bin +SUBDIRS = include lib bin .PHONY: all all: diff --git a/bin/Makefile b/bin/Makefile index 50a65e15..789233a7 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -12,18 +12,18 @@ all: .PHONY: install install: - @for dir in $(SUBDIRS); do \ + @for dir in $(SUBDIRS); do \ $(MAKE) -C $$dir install || exit 1; \ done .PHONY: uninstall uninstall: - @for bin in $(SUBDIRS); do \ - -rm -f $(SBINDIR)/$$bin; \ + @for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir uninstall || exit1; \ done .PHONY: clean clean: - @for dir in $(SUBDIRS); do \ + @for dir in $(SUBDIRS); do \ $(MAKE) -C $$dir clean || exit 1; \ done diff --git a/include/Makefile b/include/Makefile new file mode 100644 index 00000000..0af39821 --- /dev/null +++ b/include/Makefile @@ -0,0 +1,18 @@ +include ../vars.mk + +INCS = xbps_api.h + +.PHONY: all +all: + +.PHONY: install +install: + install -d $(INCLUDEDIR) + install -m 644 $(INCS) $(INCLUDEDIR) + +.PHONY: uninstall +uninstall: + -rm -f $(INCLUDEDIR)/$(INCS) + +.PHONY: clean +clean: diff --git a/vars.mk b/vars.mk index c7974469..92b3bfd3 100644 --- a/vars.mk +++ b/vars.mk @@ -3,6 +3,7 @@ PREFIX ?= /usr/local SBINDIR ?= $(DESTDIR)$(PREFIX)/sbin LIBDIR ?= $(DESTDIR)$(PREFIX)/lib +INCLUDEDIR ?= $(DESTDIR)$(PREFIX)/include MANDIR ?= $(DESTDIR)$(PREFIX)/share/man/man8 TOPDIR ?= .. INSTALL_STRIPPED ?= -s