IPStack - SCTP support, dunno how good it is, but part of it is written
[tpg/acess2.git] / AcessNative / ld-acess_src / Makefile
index 4fb6ae2..eb84ad8 100644 (file)
@@ -19,21 +19,29 @@ endif
 
 CFLAGS += -Wall -Werror -g -m32
 
+DEPFILES  = $(filter %.o.$(PLATFORM),$(OBJ))
+DEPFILES := $(DEPFILES:%.o.$(PLATFORM)=%.d.$(PLATFORM))
+
 .PHONY: all clean
 
 all: $(BIN)
 
 clean:
-       $(RM) $(BIN) $(OBJ)
+       $(RM) $(BIN) $(OBJ) $(DEPFILES)
 
 $(BIN): link.ld.$(PLATFORM) $(OBJ)
 #      $(LD) -g -o $@ $(OBJ) -T link.ld.$(PLATFORM)
        $(CC) -g -o $@ $(OBJ) -m32 -Wl,-T,link.ld.$(PLATFORM)
 
 %.o.$(PLATFORM): %.c
-       $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)
+       @echo [CC] -o $@
+       @$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)
+       @$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(PLATFORM) $<
 
 # Modify the default makefile to put the executable at 1MB instead
 link.ld.lin:
-       $(LD) --verbose | awk '{ if( substr($$0,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x0[08][0-9]*\b/0x00100000/g' > $@
+       @echo Making Linker Script ($@)
+       @$(LD) --verbose | awk '{ if( substr($$0,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x0[08][0-9]*\b/0x00100000/g' > $@
+
+-include $(DEPFILES)
 

UCC git Repository :: git.ucc.asn.au