diff --git a/Makefile.base b/Makefile.base index d5195431a265..9b32b31d8f94 100644 --- a/Makefile.base +++ b/Makefile.base @@ -29,11 +29,12 @@ $(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ) # pull in dependency info for *existing* .o files -include $(OBJ:.o=.d) -# compile and generate dependency info +# compile and generate dependency info, +# prepend path to dependency info file $(BINDIR)%.o: %.c $(AD)$(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o - $(AD)$(CC) $(CFLAGS) $(INCLUDES) -MM $*.c > $(BINDIR)$*.d - @printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d + $(AD)$(CC) $(CFLAGS) $(INCLUDES) -MM $*.c |\ + sed -e "1s|^|$(BINDIR)|" > $(BINDIR)$*.d $(BINDIR)%.o: %.s $(AD)$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$*.o diff --git a/boards/native/Makefile b/boards/native/Makefile index 2953d080a8a5..3e2f63f86020 100644 --- a/boards/native/Makefile +++ b/boards/native/Makefile @@ -9,9 +9,8 @@ include $(RIOTBASE)/Makefile.base $(BINDIR)%.o: %.c $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o - $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d - @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d - + $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c |\ + sed -e "1s|^|$(BINDIR)|" > $(BINDIR)$*.d clean:: @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/native/drivers/Makefile b/boards/native/drivers/Makefile index ce65f4ca8c5a..7a95daf23ea0 100644 --- a/boards/native/drivers/Makefile +++ b/boards/native/drivers/Makefile @@ -7,5 +7,5 @@ include $(RIOTBASE)/Makefile.base $(BINDIR)%.o: %.c $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o - $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d - @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d + $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c |\ + sed -e "1s|^|$(BINDIR)|" > $(BINDIR)$*.d diff --git a/cpu/native/Makefile b/cpu/native/Makefile index 48c3808100e8..2fea129943ad 100644 --- a/cpu/native/Makefile +++ b/cpu/native/Makefile @@ -15,9 +15,8 @@ include $(RIOTBASE)/Makefile.base $(BINDIR)%.o: %.c $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o - $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d - @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d - + $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c |\ + sed -e "1s|^|$(BINDIR)|" > $(BINDIR)$*.d clean:: @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/cpu/native/net/Makefile b/cpu/native/net/Makefile index 6f69094f8246..23492a149b68 100644 --- a/cpu/native/net/Makefile +++ b/cpu/native/net/Makefile @@ -4,5 +4,5 @@ include $(MAKEBASE)/Makefile.base $(BINDIR)%.o: %.c $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o - $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d - @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d + $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c |\ + sed -e "1s|^|$(BINDIR)|" > $(BINDIR)$*.d diff --git a/cpu/native/rtc/Makefile b/cpu/native/rtc/Makefile index 13b8ace18bb1..cab08f1b704f 100644 --- a/cpu/native/rtc/Makefile +++ b/cpu/native/rtc/Makefile @@ -4,5 +4,5 @@ include $(MAKEBASE)/Makefile.base $(BINDIR)%.o: %.c $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$*.o - $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c > $(BINDIR)$*.d - @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d + $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c |\ + sed -e "1s|^|$(BINDIR)|" > $(BINDIR)$*.d