[rtems-libbsd commit] Fix install Makefile target

Sebastian Huber sebh at rtems.org
Fri Dec 20 14:29:29 UTC 2013


Module:    rtems-libbsd
Branch:    master
Commit:    f8d99e96659fc7573f63d3375ece1697d6c87eef
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=f8d99e96659fc7573f63d3375ece1697d6c87eef

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Dec 20 15:34:57 2013 +0100

Fix install Makefile target

---

 Makefile            |   31 ++++++++++++++-----------------
 config.inc          |    2 +-
 freebsd-to-rtems.py |   31 ++++++++++++++-----------------
 3 files changed, 29 insertions(+), 35 deletions(-)

diff --git a/Makefile b/Makefile
index 3d29c19..97b55d3 100644
--- a/Makefile
+++ b/Makefile
@@ -1310,24 +1310,21 @@ CPU_SED += -e '/powerpc/d'
 CPU_SED += -e '/mips/d'
 CPU_SED += -e '/sparc64/d'
 
+LIB_DIR = $(INSTALL_BASE)/lib
+INCLUDE_DIR = $(INSTALL_BASE)/lib/include
+
 install: $(LIB)
-	install -d $(INSTALL_BASE)/include
-	install -c -m 644 $(LIB) $(INSTALL_BASE)
-	cd rtemsbsd; for i in `find freebsd -name '*.h'` ; do \
-	  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
-	cd contrib/altq; for i in `find freebsd -name '*.h'` ; do \
-	  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
-	cd contrib/pf; for i in `find freebsd -name '*.h'` ; do \
-	  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
-	for i in `find freebsd -name '*.h' | $(CPU_SED)` ; do \
-	  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
-	-cd freebsd/$(RTEMS_CPU)/include && for i in `find . -name '*.h'` ; do \
-	  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
-	-cd rtemsbsd/$(RTEMS_CPU)/include && \
-	  for i in `find . -name '*.h' | $(CPU_SED)` ; do \
-	    install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
-	-cd copied/rtemsbsd/$(RTEMS_CPU)/include && for i in `find . -name '*.h'` ; do \
-	  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done
+	install -d $(LIB_DIR)
+	install -m 644 $(LIB) $(LIB_DIR)
+	cd rtemsbsd/include ; for i in `find . -type d` ; do \
+	  install -d $(INCLUDE_DIR)/$$i ; \
+	  install -m 644 $$i/*.h $(INCLUDE_DIR)/$$i ; done
+	cd freebsd/include ; for i in `find . -type d` ; do \
+	  install -d $(INCLUDE_DIR)/$$i ; \
+	  install -m 644 $$i/*.h $(INCLUDE_DIR)/$$i ; done
+	for i in bsm cam net net80211 netatalk netinet netinet6 netipsec sys ; do \
+	  install -d $(INCLUDE_DIR)/$$i ; \
+	  install -m 644 freebsd/sys/$$i/*.h $(INCLUDE_DIR)/$$i ; done
 
 clean:
 	rm -f $(LIB_GEN_FILES) $(LIB) $(TESTS) $(O_FILES) $(D_FILES)
diff --git a/config.inc b/config.inc
index d396910..3432a5f 100644
--- a/config.inc
+++ b/config.inc
@@ -4,7 +4,7 @@ BSP = realview_pbx_a9_qemu
 PREFIX = /opt/rtems-4.11
 
 # Optional: Separate installation base directory
-INSTALL_BASE = $(PREFIX)
+INSTALL_BASE = $(PREFIX)/$(TARGET)/$(BSP)
 
 # Optional: Network test configuration
 TEST_RUNNER = $(BSP)
diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py
index c58d583..ab9579a 100755
--- a/freebsd-to-rtems.py
+++ b/freebsd-to-rtems.py
@@ -499,24 +499,21 @@ class ModuleManager:
 			'CPU_SED += -e \'/mips/d\'\n' \
 			'CPU_SED += -e \'/sparc64/d\'\n' \
 			'\n' \
+			'LIB_DIR = $(INSTALL_BASE)/lib\n' \
+			'INCLUDE_DIR = $(INSTALL_BASE)/lib/include\n' \
+			'\n' \
 			'install: $(LIB)\n' \
-			'\tinstall -d $(INSTALL_BASE)/include\n' \
-			'\tinstall -c -m 644 $(LIB) $(INSTALL_BASE)\n' \
-			'\tcd rtemsbsd; for i in `find freebsd -name \'*.h\'` ; do \\\n' \
-			'\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
-			'\tcd contrib/altq; for i in `find freebsd -name \'*.h\'` ; do \\\n' \
-			'\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
-			'\tcd contrib/pf; for i in `find freebsd -name \'*.h\'` ; do \\\n' \
-                        '\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
-			'\tfor i in `find freebsd -name \'*.h\' | $(CPU_SED)` ; do \\\n' \
-			'\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
-			'\t-cd freebsd/$(RTEMS_CPU)/include && for i in `find . -name \'*.h\'` ; do \\\n' \
-			'\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
-			'\t-cd rtemsbsd/$(RTEMS_CPU)/include && \\\n' \
-			'\t  for i in `find . -name \'*.h\' | $(CPU_SED)` ; do \\\n' \
-			'\t    install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
-			'\t-cd copied/rtemsbsd/$(RTEMS_CPU)/include && for i in `find . -name \'*.h\'` ; do \\\n' \
-			'\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
+			'\tinstall -d $(LIB_DIR)\n' \
+			'\tinstall -m 644 $(LIB) $(LIB_DIR)\n' \
+			'\tcd rtemsbsd/include ; for i in `find . -type d` ; do \\\n' \
+			'\t  install -d $(INCLUDE_DIR)/$$i ; \\\n' \
+			'\t  install -m 644 $$i/*.h $(INCLUDE_DIR)/$$i ; done\n' \
+			'\tcd freebsd/include ; for i in `find . -type d` ; do \\\n' \
+			'\t  install -d $(INCLUDE_DIR)/$$i ; \\\n' \
+			'\t  install -m 644 $$i/*.h $(INCLUDE_DIR)/$$i ; done\n' \
+			'\tfor i in bsm cam net net80211 netatalk netinet netinet6 netipsec sys ; do \\\n' \
+			'\t  install -d $(INCLUDE_DIR)/$$i ; \\\n' \
+			'\t  install -m 644 freebsd/sys/$$i/*.h $(INCLUDE_DIR)/$$i ; done\n' \
 			'\n' \
 			'clean:\n' \
 			'\trm -f $(LIB_GEN_FILES) $(LIB) $(TESTS) $(O_FILES) $(D_FILES)\n' \




More information about the vc mailing list