aboutsummaryrefslogtreecommitdiffstats
path: root/mk/lang-c.mk
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2016-01-04 23:04:58 +0100
committerMattias Andrée <maandree@member.fsf.org>2016-01-04 23:04:58 +0100
commit73e83f270afd9c662a16297f6a6cae297bcae9ae (patch)
tree57892e50f1fefa4a8156acc2626d69b074476436 /mk/lang-c.mk
parentm + makefile + configure (diff)
downloadlibhaiku-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>
Diffstat (limited to '')
-rw-r--r--mk/lang-c.mk11
1 files changed, 8 insertions, 3 deletions
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
-