1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

pipe through sed instead

addresses: https://github.com/RIOT-OS/RIOT/pull/778#discussion_r10041955
This commit is contained in:
Ludwig Ortmann 2014-02-26 09:18:42 +01:00
parent 7229287e47
commit 1bd3f7bb86
2 changed files with 6 additions and 6 deletions

View File

@ -29,12 +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
@# prepend path to dependency info file
$(AD)sed -i -e "1s|^|$(BINDIR)|" $(BINDIR)$*.d
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -MM $*.c |\
sed -e "1s|^|$(BINDIR)|" > $(BINDIR)$*.d
$(BINDIR)%.o: %.s
$(AD)$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$*.o

View File

@ -15,8 +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::