j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: blueswirl Date: Wed Nov 17 20:36:18 2010 New Revision: 961 URL: http://tracker.coreboot.org/trac/openbios/changeset/961
Log: Introduce automatic build dependencies
Use GCC to generate dependency files.
Tested-by: Andreas Färber andreas.faerber@web.de Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/Makefile.target trunk/openbios-devel/config/xml/rules.xml
Modified: trunk/openbios-devel/Makefile.target ============================================================================== --- trunk/openbios-devel/Makefile.target Wed Nov 17 20:36:16 2010 (r960) +++ trunk/openbios-devel/Makefile.target Wed Nov 17 20:36:18 2010 (r961) @@ -14,6 +14,8 @@ HOSTCFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels HOSTCFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs HOSTCFLAGS+= -W +# Flags for dependency generation +HOSTCFLAGS+= -MMD -MP -MT $@ -MF '$(*D)/$(*F).d' HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
CC := $(TARGET)gcc @@ -29,6 +31,8 @@ CFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels CFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs CFLAGS+= -Werror +# Flags for dependency generation +CFLAGS+= -MMD -MP -MT $@ -MF '$(*D)/$(*F).d' INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include AS_FLAGS+= -g
@@ -63,7 +67,7 @@ @printf "Cleaning up for $(ARCH)..." @rm -rf forth.dict.core forthstrap *.dict openbios-* @rm -f $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs - @find . -type f ( -name "*~" -o -name '*.o' -o -name '*.a' ) -exec rm {} ; + @find . -type f ( -name "*~" -o -name '*.o' -o -name '*.d' -o -name '*.a' ) -exec rm {} ; @echo " ok"
build-verbose: info build @@ -71,3 +75,6 @@ build: all
include rules.mak + +# Include automatically generated dependency files +-include $(wildcard $(ODIR)/host/kernel/*.d $(ODIR)/target/*/*.d $(ODIR)/target/*/*/*.d $(ODIR)/target/*/*/*/*.d)
Modified: trunk/openbios-devel/config/xml/rules.xml ============================================================================== --- trunk/openbios-devel/config/xml/rules.xml Wed Nov 17 20:36:16 2010 (r960) +++ trunk/openbios-devel/config/xml/rules.xml Wed Nov 17 20:36:18 2010 (r961) @@ -4,11 +4,11 @@ $(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) -o $@ $^," HOSTCC $(TARGET_DIR)$@") </rule> <rule target="host" entity="object"> - $(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES) -c -o $@ $^," HOSTCC $(TARGET_DIR)$@") + $(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES) -c -o $@ $<," HOSTCC $(TARGET_DIR)$@") </rule> <rule target="host" entity="object" extracflags="1"> $(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES)</rule> -<rule target="host" entity="object" extracflags="2"> -c -o $@ $^," HOSTCC $(TARGET_DIR)$@") +<rule target="host" entity="object" extracflags="2"> -c -o $@ $<," HOSTCC $(TARGET_DIR)$@") </rule> <rule target="host" entity="library"> $(call quiet--command,$(AR) cru $@ $^; $(RANLIB) $@," HOSTAR $(TARGET_DIR)$@") @@ -19,11 +19,11 @@ $(call quiet-command,$(CC) $(CFLAGS) -o $@ $^," CC $(TARGET_DIR)$@") </rule> <rule target="target" entity="object"> - $(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $^," CC $(TARGET_DIR)$@") + $(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $<," CC $(TARGET_DIR)$@") </rule> <rule target="target" entity="object" extracflags="1"> $(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES)</rule> -<rule target="target" entity="object" extracflags="2"> -c -o $@ $^," CC $(TARGET_DIR)$@") +<rule target="target" entity="object" extracflags="2"> -c -o $@ $<," CC $(TARGET_DIR)$@") </rule> <rule target="target" entity="library"> $(call quiet-command,$(AR) cru $@ $^; $(RANLIB) $@," AR $(TARGET_DIR)$@")