diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2016-01-04 23:04:58 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2016-01-04 23:04:58 +0100 |
commit | 73e83f270afd9c662a16297f6a6cae297bcae9ae (patch) | |
tree | 57892e50f1fefa4a8156acc2626d69b074476436 | |
parent | m + makefile + configure (diff) | |
download | libhaiku-73e83f270afd9c662a16297f6a6cae297bcae9ae.tar.gz libhaiku-73e83f270afd9c662a16297f6a6cae297bcae9ae.tar.bz2 libhaiku-73e83f270afd9c662a16297f6a6cae297bcae9ae.tar.xz |
install and uninstall header files
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-rw-r--r-- | Makefile.in | 5 | ||||
-rw-r--r-- | mk/lang-c.mk | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/Makefile.in b/Makefile.in index 44c5e99..d784fa2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -49,6 +49,7 @@ _LIB = libhaiku _OBJ_libhaiku = libhaiku _SO_VERSION_libhaiku = $(_VERSION) _SO_MAJOR_libhaiku = $(shell echo $(_SO_VERSION_libhaiku) | cut -d . -f 1) +_H = libhaiku _HEADER_DIRLEVELS = 1 _CPPFLAGS = -D'PACKAGE="$(PKGNAME)"' -D'PROGRAM_VERSION="$(_VERSION)"' @@ -56,9 +57,7 @@ _CPPFLAGS = -D'PACKAGE="$(PKGNAME)"' -D'PROGRAM_VERSION="$(_VERSION)"' _COPYING = COPYING # Used by mk/dist.mk -___EVERYTHING_H = libhaiku.h -_EVERYTHING = $(foreach F,$(___EVERYTHING_H),src/$(F).h) \ - $(__EVERYTHING_ALL_COMMON) +_EVERYTHING = $(__EVERYTHING_ALL_COMMON) src/libhaiku.c src/libhaiku.h # }} diff --git a/mk/lang-c.mk b/mk/lang-c.mk index 554c9c4..91bc86e 100644 --- a/mk/lang-c.mk +++ b/mk/lang-c.mk @@ -55,7 +55,10 @@ # library, sould should also define # _SO_VERSION_$(LIBRARY) and _SO_MAJOR_$(LIBRARY) # with the full version number and the major -# version number, respectively. +# version number, respectively. Additionally, +# list all header files that shall be installed +# in _H, these should not contain the 'src/' prefix +# or the '.h' suffix. ifdef _C_STD @@ -267,6 +270,8 @@ install-lib-c: $(foreach B,$(_LIB),bin/$(B).so) $(Q)$(foreach B,$(_LIB),$(LN) -sf -- "$(B).so.$(_SO_VERSION_$(B))" "$(DESTDIR)$(LIBDIR)/$(B).so.$(_SO_MAJOR_$(B))" &&) $(TRUE) $(Q)$(foreach B,$(_LIB),$(INSTALL_PROGRAM) $(foreach B,$(_LIB),bin/$(B).so) -- "$(DESTDIR)$(LIBDIR)/$(B).so.$(_SO_VERSION_$(B))" &&) $(TRUE) $(Q)$(foreach B,$(_LIB),$(LN) -sf -- "$(B).so.$(_SO_VERSION_$(B))" "$(DESTDIR)$(LIBDIR)/$(B).so" &&) $(TRUE) + $(Q)$(INSTALL_DIR) -- $(foreach H,$(_H),"$(DESTDIR)$(INCLUDEDIR)/$(shell dirname "$(H)")") + $(Q)$(foreach H,$(_H),$(INSTALL_DATA) "src/$(H).h" -- "$(DESTDIR)$(INCLUDEDIR)/$(H).h" &&) $(TRUE) @$(ECHO_EMPTY) @@ -295,8 +300,8 @@ uninstall-lib-c: -$(Q)$(RM) -- $(foreach B,$(_LIB),"$(DESTDIR)$(LIBDIR)/$(B).so") -$(Q)$(RM) -- $(foreach B,$(_LIB),"$(DESTDIR)$(LIBDIR)/$(B).so.$(_SO_MAJOR_$(B))") -$(Q)$(RM) -- $(foreach B,$(_LIB),"$(DESTDIR)$(LIBDIR)/$(B).so.$(_SO_VERSION_$(B))") + -$(Q)$(RM) -- $(foreach H,$(_H),"$(DESTDIR)$(INCLUDEDIR)/$(H).h") + -$(Q)$(foreach H,$(_H),if [ ! "$(shell echo "$(H)" | cut -d / -f 1)" = "$(H)" ]; then $(RMDIR) -- "$(DESTDIR)$(INCLUDEDIR)/$(shell dirname "$(H)")"; fi;) endif -# TODO install/uninstall header files - |