From c0a28f0f62cfa964aafe546b4464c12f1816390a Mon Sep 17 00:00:00 2001 From: Luigi Rinaldi <luigi.rnl@gmail.com> Date: Tue, 15 Jan 2013 11:24:59 +0100 Subject: [PATCH] Fixed autodependecies. --- Makefile | 21 +++++++++++---------- app_template/Makefile | 19 ++++++++++--------- app_template_withlibs/Makefile | 19 ++++++++++--------- miosix/Makefile | 19 ++++++++++--------- mpu_testsuite/mpu_apps/test1/Makefile | 19 ++++++++++--------- mpu_testsuite/mpu_apps/test2/Makefile | 19 ++++++++++--------- mpu_testsuite/mpu_apps/test3/Makefile | 19 ++++++++++--------- mpu_testsuite/mpu_apps/test4/Makefile | 19 ++++++++++--------- mpu_testsuite/mpu_apps/test5/Makefile | 19 ++++++++++--------- 9 files changed, 91 insertions(+), 82 deletions(-) diff --git a/Makefile b/Makefile index 3e615d0e..a8efb902 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ CFLAGS := $(CFLAGS_BASE) -I. -Imiosix -Imiosix/arch/common \ -Imiosix/$(ARCH_INC) -Imiosix/$(BOARD_INC) $(INCLUDE_DIRS) AFLAGS := $(AFLAGS_BASE) LFLAGS := $(LFLAGS_BASE) -DFLAGS := -MM +DFLAGS := -MMD -MP LINK_LIBS := $(LIBS) -L./miosix -Wl,--start-group -lmiosix -lstdc++ -lc -lm \ -lgcc -Wl,--end-group @@ -63,7 +63,7 @@ clean-recursive: done clean-topdir: - -rm $(OBJ) main.elf main.hex main.bin main.map *.d + -rm $(OBJ) main.elf main.hex main.bin main.map $(OBJ:.o=.d) main: main.elf $(CP) -O ihex main.elf main.hex @@ -71,19 +71,20 @@ main: main.elf $(SZ) main.elf main.elf: $(OBJ) miosix/libmiosix.a - @ echo "linking" + @ echo "========Linking========" $(CXX) $(LFLAGS) -o main.elf $(OBJ) miosix/$(BOOT_FILE) $(LINK_LIBS) -#pull in dependecy info for existing .o files --include $(OBJ:.o=.d) - %.o: %.s + @echo "========Compiling $<========" $(AS) $(AFLAGS) $< -o $@ %.o : %.c - $(CC) $(CFLAGS) $< -o $@ - $(CC) $(DFLAGS) $(CFLAGS) $*.c > $*.d + @echo "========Compiling $<========" + $(CC) $(DFLAGS) $(CFLAGS) $< -o $@ %.o : %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ - $(CXX) $(DFLAGS) $(CXXFLAGS) $*.cpp > $*.d + @echo "========Compiling $<========" + $(CXX) $(DFLAGS) $(CXXFLAGS) $< -o $@ + +#pull in dependecy info for existing .o files +-include $(OBJ:.o=.d) diff --git a/app_template/Makefile b/app_template/Makefile index 7a0c7f8e..b0605b7e 100644 --- a/app_template/Makefile +++ b/app_template/Makefile @@ -21,7 +21,7 @@ CXXFLAGS := $(CFLAGS) LFLAGS := -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fpie -msingle-pic-base \ -Wl,--gc-sections,-Map,main.map,-T./miosix.ld,-n,-pie,--spare-dynamic-tags,3 \ -O2 -nostdlib -DFLAGS := -MM +DFLAGS := -MMD -MP LINK_LIBS := -Wl,--start-group -lstdc++ -lc -lm -lgcc -Wl,--end-group @@ -33,18 +33,19 @@ all: $(OBJ) crt0.o @xxd -i main.elf | sed 's/unsigned char/const unsigned char __attribute__((aligned(8)))/' > prog3.h clean: - -rm $(OBJ) crt0.o main.elf main.map main.txt prog3.h *.d - -#pull in dependecy info for existing .o files --include $(OBJ:.o=.d) + -rm $(OBJ) crt0.o main.elf main.map main.txt prog3.h $(OBJ:.o=.d) %.o: %.s + @echo "========Compiling $<========" $(AS) $(AFLAGS) $< -o $@ %.o : %.c - $(CC) $(CFLAGS) $< -o $@ - $(CC) $(DFLAGS) $(CFLAGS) $*.c > $*.d + @echo "========Compiling $<========" + $(CC) $(DFLAGS) $(CFLAGS) $< -o $@ %.o : %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ - $(CXX) $(DFLAGS) $(CXXFLAGS) $*.cpp > $*.d \ No newline at end of file + @echo "========Compiling $<========" + $(CXX) $(DFLAGS) $(CXXFLAGS) $< -o $@ + +#pull in dependecy info for existing .o files +-include $(OBJ:.o=.d) diff --git a/app_template_withlibs/Makefile b/app_template_withlibs/Makefile index 6d6bad5f..96bd2c51 100644 --- a/app_template_withlibs/Makefile +++ b/app_template_withlibs/Makefile @@ -22,7 +22,7 @@ CXXFLAGS := $(CFLAGS) LFLAGS := -mcpu=cortex-m3 -mthumb -fpie -msingle-pic-base \ -Wl,--gc-sections,-Map,main.map,-T./miosix.ld,-n,-pie,--spare-dynamic-tags,3 \ -O2 -nostdlib -DFLAGS := -MM +DFLAGS := -MMD -MP # LFLAGS := -mcpu=cortex-m3 -mthumb -fpie -msingle-pic-base \ # -Wl,--gc-sections,-Map,main.map,-T./miosix.ld,-n,-pie,--spare-dynamic-tags,3 \ @@ -37,18 +37,19 @@ all: $(OBJ) crt0.o @xxd -i main.elf | sed 's/unsigned char/const unsigned char __attribute__((aligned(8)))/' > prog3.h clean: - -rm $(OBJ) crt0.o main.elf main.map *.d - -#pull in dependecy info for existing .o files --include $(OBJ:.o=.d) + -rm $(OBJ) crt0.o main.elf main.map $(OBJ:.o=.d) %.o: %.s + @echo "========Compiling $<========" $(AS) $(AFLAGS) $< -o $@ %.o : %.c - $(CC) $(CFLAGS) $< -o $@ - $(CC) $(DFLAGS) $(CFLAGS) $*.c > $*.d + @echo "========Compiling $<========" + $(CC) $(DFLAGS) $(CFLAGS) $< -o $@ %.o : %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ - $(CXX) $(DFLAGS) $(CXXFLAGS) $*.cpp > $*.d + @echo "========Compiling $<========" + $(CXX) $(DFLAGS) $(CXXFLAGS) $< -o $@ + +#pull in dependecy info for existing .o files +-include $(OBJ:.o=.d) diff --git a/miosix/Makefile b/miosix/Makefile index 9a0675ee..f2d3f280 100644 --- a/miosix/Makefile +++ b/miosix/Makefile @@ -44,7 +44,7 @@ OBJ := $(addsuffix .o, $(basename $(SRC))) CXXFLAGS := $(CXXFLAGS_BASE) -I. -Iarch/common -I$(ARCH_INC) -I$(BOARD_INC) CFLAGS := $(CFLAGS_BASE) -I. -Iarch/common -I$(ARCH_INC) -I$(BOARD_INC) AFLAGS := $(AFLAGS_BASE) -DFLAGS := -MM +DFLAGS := -MMD -MP ## Build libmiosix.a and stage_1_boot.o (whose path is in BOOT_FILE) ## The file stage_1_boot.o is compiled separately because @@ -53,18 +53,19 @@ all: $(OBJ) $(BOOT_FILE) $(AR) rcs libmiosix.a $(OBJ) clean: - -rm $(OBJ) $(BOOT_FILE) libmiosix.a *.d - -#pull in dependecy info for existing .o files --include $(OBJ:.o=.cpp.d) + -rm $(OBJ) $(BOOT_FILE) libmiosix.a $(OBJ:.o=.d) %.o: %.s + @echo "========Compiling $<========" $(AS) $(AFLAGS) $< -o $@ %.o : %.c - $(CC) $(CFLAGS) $< -o $@ - $(CC) $(DFLAGS) $(CFLAGS) $*.c > $*.d + @echo "========Compiling $<========" + $(CC) $(DFLAGS) $(CFLAGS) $< -o $@ %.o : %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ - $(CXX) $(DFLAGS) $(CXXFLAGS) $*.cpp > $*.d + @echo "========Compiling $<========" + $(CXX) $(DFLAGS) $(CXXFLAGS) $< -o $@ + +#pull in dependecy info for existing .o files +-include $(OBJ:.o=.d) diff --git a/mpu_testsuite/mpu_apps/test1/Makefile b/mpu_testsuite/mpu_apps/test1/Makefile index 994dae76..ac9e07ca 100644 --- a/mpu_testsuite/mpu_apps/test1/Makefile +++ b/mpu_testsuite/mpu_apps/test1/Makefile @@ -21,7 +21,7 @@ CXXFLAGS := $(CFLAGS) LFLAGS := -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fpie -msingle-pic-base \ -Wl,--gc-sections,-Map,test.map,-T./miosix.ld,-n,-pie,--spare-dynamic-tags,3 \ -O2 -nostdlib -DFLAGS := -MM +DFLAGS := -MMD -MP LINK_LIBS := -Wl,--start-group -lstdc++ -lc -lm -lgcc -Wl,--end-group @@ -33,18 +33,19 @@ all: $(OBJ) crt0.o @xxd -i test.elf | sed 's/unsigned char/const unsigned char __attribute__((aligned(8)))/' > mpuTest.h clean: - -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h *.d - -#pull in dependecy info for existing .o files --include $(OBJ:.o=.d) + -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h $(OBJ:.o=.d) %.o: %.s + @echo "========Compiling $<========" $(AS) $(AFLAGS) $< -o $@ %.o : %.c - $(CC) $(CFLAGS) $< -o $@ - $(CC) $(DFLAGS) $(CFLAGS) $*.c > $*.d + @echo "========Compiling $<========" + $(CC) $(DFLAGS) $(CFLAGS) $< -o $@ %.o : %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ - $(CXX) $(DFLAGS) $(CXXFLAGS) $*.cpp > $*.d + @echo "========Compiling $<========" + $(CXX) $(DFLAGS) $(CXXFLAGS) $< -o $@ + +#pull in dependecy info for existing .o files +-include $(OBJ:.o=.d) diff --git a/mpu_testsuite/mpu_apps/test2/Makefile b/mpu_testsuite/mpu_apps/test2/Makefile index 994dae76..ac9e07ca 100644 --- a/mpu_testsuite/mpu_apps/test2/Makefile +++ b/mpu_testsuite/mpu_apps/test2/Makefile @@ -21,7 +21,7 @@ CXXFLAGS := $(CFLAGS) LFLAGS := -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fpie -msingle-pic-base \ -Wl,--gc-sections,-Map,test.map,-T./miosix.ld,-n,-pie,--spare-dynamic-tags,3 \ -O2 -nostdlib -DFLAGS := -MM +DFLAGS := -MMD -MP LINK_LIBS := -Wl,--start-group -lstdc++ -lc -lm -lgcc -Wl,--end-group @@ -33,18 +33,19 @@ all: $(OBJ) crt0.o @xxd -i test.elf | sed 's/unsigned char/const unsigned char __attribute__((aligned(8)))/' > mpuTest.h clean: - -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h *.d - -#pull in dependecy info for existing .o files --include $(OBJ:.o=.d) + -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h $(OBJ:.o=.d) %.o: %.s + @echo "========Compiling $<========" $(AS) $(AFLAGS) $< -o $@ %.o : %.c - $(CC) $(CFLAGS) $< -o $@ - $(CC) $(DFLAGS) $(CFLAGS) $*.c > $*.d + @echo "========Compiling $<========" + $(CC) $(DFLAGS) $(CFLAGS) $< -o $@ %.o : %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ - $(CXX) $(DFLAGS) $(CXXFLAGS) $*.cpp > $*.d + @echo "========Compiling $<========" + $(CXX) $(DFLAGS) $(CXXFLAGS) $< -o $@ + +#pull in dependecy info for existing .o files +-include $(OBJ:.o=.d) diff --git a/mpu_testsuite/mpu_apps/test3/Makefile b/mpu_testsuite/mpu_apps/test3/Makefile index 994dae76..ac9e07ca 100644 --- a/mpu_testsuite/mpu_apps/test3/Makefile +++ b/mpu_testsuite/mpu_apps/test3/Makefile @@ -21,7 +21,7 @@ CXXFLAGS := $(CFLAGS) LFLAGS := -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fpie -msingle-pic-base \ -Wl,--gc-sections,-Map,test.map,-T./miosix.ld,-n,-pie,--spare-dynamic-tags,3 \ -O2 -nostdlib -DFLAGS := -MM +DFLAGS := -MMD -MP LINK_LIBS := -Wl,--start-group -lstdc++ -lc -lm -lgcc -Wl,--end-group @@ -33,18 +33,19 @@ all: $(OBJ) crt0.o @xxd -i test.elf | sed 's/unsigned char/const unsigned char __attribute__((aligned(8)))/' > mpuTest.h clean: - -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h *.d - -#pull in dependecy info for existing .o files --include $(OBJ:.o=.d) + -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h $(OBJ:.o=.d) %.o: %.s + @echo "========Compiling $<========" $(AS) $(AFLAGS) $< -o $@ %.o : %.c - $(CC) $(CFLAGS) $< -o $@ - $(CC) $(DFLAGS) $(CFLAGS) $*.c > $*.d + @echo "========Compiling $<========" + $(CC) $(DFLAGS) $(CFLAGS) $< -o $@ %.o : %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ - $(CXX) $(DFLAGS) $(CXXFLAGS) $*.cpp > $*.d + @echo "========Compiling $<========" + $(CXX) $(DFLAGS) $(CXXFLAGS) $< -o $@ + +#pull in dependecy info for existing .o files +-include $(OBJ:.o=.d) diff --git a/mpu_testsuite/mpu_apps/test4/Makefile b/mpu_testsuite/mpu_apps/test4/Makefile index 994dae76..ac9e07ca 100644 --- a/mpu_testsuite/mpu_apps/test4/Makefile +++ b/mpu_testsuite/mpu_apps/test4/Makefile @@ -21,7 +21,7 @@ CXXFLAGS := $(CFLAGS) LFLAGS := -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fpie -msingle-pic-base \ -Wl,--gc-sections,-Map,test.map,-T./miosix.ld,-n,-pie,--spare-dynamic-tags,3 \ -O2 -nostdlib -DFLAGS := -MM +DFLAGS := -MMD -MP LINK_LIBS := -Wl,--start-group -lstdc++ -lc -lm -lgcc -Wl,--end-group @@ -33,18 +33,19 @@ all: $(OBJ) crt0.o @xxd -i test.elf | sed 's/unsigned char/const unsigned char __attribute__((aligned(8)))/' > mpuTest.h clean: - -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h *.d - -#pull in dependecy info for existing .o files --include $(OBJ:.o=.d) + -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h $(OBJ:.o=.d) %.o: %.s + @echo "========Compiling $<========" $(AS) $(AFLAGS) $< -o $@ %.o : %.c - $(CC) $(CFLAGS) $< -o $@ - $(CC) $(DFLAGS) $(CFLAGS) $*.c > $*.d + @echo "========Compiling $<========" + $(CC) $(DFLAGS) $(CFLAGS) $< -o $@ %.o : %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ - $(CXX) $(DFLAGS) $(CXXFLAGS) $*.cpp > $*.d + @echo "========Compiling $<========" + $(CXX) $(DFLAGS) $(CXXFLAGS) $< -o $@ + +#pull in dependecy info for existing .o files +-include $(OBJ:.o=.d) diff --git a/mpu_testsuite/mpu_apps/test5/Makefile b/mpu_testsuite/mpu_apps/test5/Makefile index 994dae76..ac9e07ca 100644 --- a/mpu_testsuite/mpu_apps/test5/Makefile +++ b/mpu_testsuite/mpu_apps/test5/Makefile @@ -21,7 +21,7 @@ CXXFLAGS := $(CFLAGS) LFLAGS := -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fpie -msingle-pic-base \ -Wl,--gc-sections,-Map,test.map,-T./miosix.ld,-n,-pie,--spare-dynamic-tags,3 \ -O2 -nostdlib -DFLAGS := -MM +DFLAGS := -MMD -MP LINK_LIBS := -Wl,--start-group -lstdc++ -lc -lm -lgcc -Wl,--end-group @@ -33,18 +33,19 @@ all: $(OBJ) crt0.o @xxd -i test.elf | sed 's/unsigned char/const unsigned char __attribute__((aligned(8)))/' > mpuTest.h clean: - -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h *.d - -#pull in dependecy info for existing .o files --include $(OBJ:.o=.d) + -rm $(OBJ) crt0.o test.elf test.map test.txt mpuTest.h $(OBJ:.o=.d) %.o: %.s + @echo "========Compiling $<========" $(AS) $(AFLAGS) $< -o $@ %.o : %.c - $(CC) $(CFLAGS) $< -o $@ - $(CC) $(DFLAGS) $(CFLAGS) $*.c > $*.d + @echo "========Compiling $<========" + $(CC) $(DFLAGS) $(CFLAGS) $< -o $@ %.o : %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ - $(CXX) $(DFLAGS) $(CXXFLAGS) $*.cpp > $*.d + @echo "========Compiling $<========" + $(CXX) $(DFLAGS) $(CXXFLAGS) $< -o $@ + +#pull in dependecy info for existing .o files +-include $(OBJ:.o=.d) -- GitLab