summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-26 09:23:16 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-26 09:23:16 +0000
commit7e89cafc042bef23c2c08ac50790b48364b94013 (patch)
tree4711c58430b883cb71f371832ece7e1c5e296c9d
parent01c4f9f8dfd20b55889252dbf6821c740c2d2646 (diff)
Added automatic dependency generation to makefile
git-svn-id: https://svn.openpcd.org:2342/trunk@354 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
-rw-r--r--openpicc/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/openpicc/Makefile b/openpicc/Makefile
index 2b08878..e35dc27 100644
--- a/openpicc/Makefile
+++ b/openpicc/Makefile
@@ -38,6 +38,10 @@ OPTIM=-O2
LDSCRIPT=config/atmel-rom.ld
ARCH=AT91SAM7S256
+# Automatic dependency generation as per http://make.paulandlesley.org/autodep.html
+DEPDIR = .deps
+df = $(DEPDIR)/$(*F)
+
#
# CFLAGS common to both the THUMB and ARM mode builds
#
@@ -62,7 +66,8 @@ CFLAGS= \
-T$(LDSCRIPT) \
$(DEBUG) \
$(OPTIM) \
--fomit-frame-pointer
+-fomit-frame-pointer \
+-MD
LINKER_FLAGS=-Xlinker -oopenpicc.elf -Xlinker -M -Xlinker -Map=openpicc.map
@@ -99,7 +104,6 @@ ARM_SRC= \
os/core/MemMang/heap_2.c \
os/usb/USB-CDC.c \
os/usb/USBIsr.c
-# application/mesh/mesh.c \
#
# Define all object files.
@@ -126,13 +130,18 @@ $(FREERTOS_THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h
$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h config/board.h
$(CC) -c $(CFLAGS) $< -o $@
+ @mkdir -p $(DEPDIR); cp $*.d $(df).P; \
+ rm -f $*.d
clean :
touch Makefile
find -name '*.o' -exec rm \{\} \;
rm -f openpicc.bin openpicc.elf openpicc.map openpicc.asm config/compile.h
+ rm -rf $(DEPDIR)
.PHONY: config/compile.h
config/compile.h:
scripts/mkcompile_h > config/compile.h
application/cmd.o: config/compile.h
+
+-include $(DEPDIR)/*.P
personal git repositories of Harald Welte. Your mileage may vary