diff --git a/Makefile.base b/Makefile.base
index cdc3efd752c340f84ccc9000c5a2c3de752dc839..9b32b31d8f948e7da5eafbc5fa8453b2cdf04f52 100644
--- a/Makefile.base
+++ b/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
diff --git a/cpu/native/Makefile b/cpu/native/Makefile
index 48c3808100e8ebfb2c33da663a2225bf5c352b9a..44cc8928a3ddc4a1ed9118d7cb998fac2805a2c7 100644
--- a/cpu/native/Makefile
+++ b/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::