[dpdk-dev] [PATCH 5/7] mk: Add hierarchy-file support (include)

Mario Carrillo mario.alfredo.c.arevalo at intel.com
Fri Sep 18 22:33:08 CEST 2015


Add hierarchy-file support to the DPDK headers,
when invoking "make install H=1" (hierarchy-file)

This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

headers will be installed in: $(DESTDIR)/usr/include

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo at intel.com>
---
 mk/internal/rte.install-post.mk | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/mk/internal/rte.install-post.mk b/mk/internal/rte.install-post.mk
index 77addee..20c6a8b 100644
--- a/mk/internal/rte.install-post.mk
+++ b/mk/internal/rte.install-post.mk
@@ -63,9 +63,22 @@ $(addprefix $(RTE_OUTPUT)/$(1)/,$(notdir $(2))): $(2)
 		$(RTE_OUTPUT)/$(1)
 endef
 
+#
+# generate rules to install headers in
+# /usr/include
+#
+define copy_header_dir_rule
+ifeq ($(H),1)
+HEADER_DIR := $$(shell echo $(1) | sed 's/include\/*//')
+$$(shell [ -d $(INCLUDE_DIR)/$(HEADER_DIR) ] || mkdir -p $(INCLUDE_DIR)/$(HEADER_DIR))
+$$(shell cp -rf $(VPATH)/$(2) $(INCLUDE_DIR)/$(HEADER_DIR))
+endif
+endef
+
 $(foreach dir,$(SYMLINK-DIRS-y),\
 	$(foreach file,$(SYMLINK-y-$(dir)),\
-		$(eval $(call symlink_rule,$(dir),$(file)))))
+		$(eval $(call symlink_rule,$(dir),$(file))) \
+		$(eval $(call copy_header_dir_rule,$(dir),$(file)))))
 
 
 # fast way, no need to do preinstall and postinstall
-- 
2.1.0



More information about the dev mailing list