Ludwig Ortmann 9 years ago
parent
commit
1bd3f7bb86
  1. 8
      Makefile.base
  2. 4
      cpu/native/Makefile

8
Makefile.base

@ -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

4
cpu/native/Makefile

@ -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::

Loading…
Cancel
Save