[rtems-libbsd commit] Add dependency generation

Sebastian Huber sebh at rtems.org
Thu Apr 19 07:19:57 UTC 2012


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Apr 19 09:22:28 2012 +0200

Add dependency generation

---

 .gitignore          |    1 +
 Makefile            |    7 ++++---
 freebsd-to-rtems.py |    7 ++++---
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index 66100e6..13dc211 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
+*.d
 libbsd.html
diff --git a/Makefile b/Makefile
index 6ebebc2..b6d9ac2 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ CFLAGS += -I contrib/pf
 CFLAGS += -B $(INSTALL_BASE) 
 CFLAGS += -w 
 CFLAGS += -std=gnu99
+CFLAGS += -MT $@ -MD -MP -MF $(basename $@).d
 
 C_FILES =
 C_FILES += rtemsbsd/dev/usb/controller/ohci_lpc24xx.c
@@ -422,7 +423,7 @@ C_FILES += freebsd/sparc64/sparc64/in_cksum.c
 endif
 
 C_O_FILES = $(C_FILES:%.c=%.o)
-C_DEP_FILES = $(C_FILES:%.c=%.dep)
+C_D_FILES = $(C_FILES:%.c=%.d)
 
 LIB = libbsd.a
 
@@ -444,10 +445,10 @@ install: $(LIB)
 
 clean:
 	rm -f -r $(PROJECT_INCLUDE)/rtems/freebsd
-	rm -f $(LIB) $(C_O_FILES) $(C_DEP_FILES)
+	rm -f $(LIB) $(C_O_FILES) $(C_D_FILES)
 	rm -f libbsd.html
 
--include $(C_DEP_FILES)
+-include $(C_D_FILES)
 
 doc: libbsd.html
 
diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py
index 597c5ac..0a7b735 100755
--- a/freebsd-to-rtems.py
+++ b/freebsd-to-rtems.py
@@ -347,6 +347,7 @@ class ModuleManager:
 			'CFLAGS += -B $(INSTALL_BASE) \n' \
 			'CFLAGS += -w \n' \
 			'CFLAGS += -std=gnu99\n' \
+			'CFLAGS += -MT $@ -MD -MP -MF $(basename $@).d\n' \
 			'\n'
 		data += 'C_FILES =\n'
 		for m in self.modules:
@@ -359,7 +360,7 @@ class ModuleManager:
 				data += 'endif\n'
 		data += '\n' \
 			'C_O_FILES = $(C_FILES:%.c=%.o)\n' \
-			'C_DEP_FILES = $(C_FILES:%.c=%.dep)\n' \
+			'C_D_FILES = $(C_FILES:%.c=%.d)\n' \
 			'\n' \
 			'LIB = libbsd.a\n' \
 			'\n' \
@@ -381,10 +382,10 @@ class ModuleManager:
 			'\n' \
 			'clean:\n' \
 			'\trm -f -r $(PROJECT_INCLUDE)/rtems/freebsd\n' \
-			'\trm -f $(LIB) $(C_O_FILES) $(C_DEP_FILES)\n' \
+			'\trm -f $(LIB) $(C_O_FILES) $(C_D_FILES)\n' \
 			'\trm -f libbsd.html\n' \
 			'\n' \
-			'-include $(C_DEP_FILES)\n' \
+			'-include $(C_D_FILES)\n' \
 			'\n' \
 			'doc: libbsd.html\n' \
 			'\n' \




More information about the vc mailing list