Make make rebuild on header changes
This commit is contained in:
parent
a67d2a1945
commit
1cabaf2b04
3 changed files with 8 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
||||||
*.o
|
*.o
|
||||||
*.a
|
*.a
|
||||||
|
*.d
|
||||||
*.elf
|
*.elf
|
||||||
*.img
|
*.img
|
||||||
*.lst
|
*.lst
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -19,7 +19,7 @@ all: $(TARGET)
|
||||||
|
|
||||||
$(TARGET): $(OBJS) $(LIBS)
|
$(TARGET): $(OBJS) $(LIBS)
|
||||||
@echo " LINK $@"
|
@echo " LINK $@"
|
||||||
$(Q)$(CC) $(CFLAGS) -o $(TARGET).elf -Xlinker -Map=$(TARGET).map -T linker.ld -nostartfiles $(OBJS) $(LIBS)
|
$(Q)$(CXX) $(CFLAGS) -o $(TARGET).elf -Xlinker -Map=$(TARGET).map -T linker.ld -nostartfiles $(OBJS) $(LIBS)
|
||||||
$(Q)$(PREFIX)objdump -d $(TARGET).elf | $(PREFIX)c++filt > $(TARGET).lst
|
$(Q)$(PREFIX)objdump -d $(TARGET).elf | $(PREFIX)c++filt > $(TARGET).lst
|
||||||
$(Q)$(PREFIX)objcopy $(TARGET).elf -O binary $(TARGET).img
|
$(Q)$(PREFIX)objcopy $(TARGET).elf -O binary $(TARGET).img
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ PREFIX ?= arm-none-eabi-
|
||||||
|
|
||||||
CC = $(PREFIX)gcc
|
CC = $(PREFIX)gcc
|
||||||
CPP = $(PREFIX)g++
|
CPP = $(PREFIX)g++
|
||||||
|
CXX = $(PREFIX)g++
|
||||||
AS = $(CC)
|
AS = $(CC)
|
||||||
LD = $(PREFIX)ld
|
LD = $(PREFIX)ld
|
||||||
AR = $(PREFIX)ar
|
AR = $(PREFIX)ar
|
||||||
|
@ -39,10 +40,13 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
AFLAGS += $(ARCH)
|
AFLAGS += $(ARCH)
|
||||||
CFLAGS += $(ARCH) -Wall -Wno-unused-variable -Wno-unused-but-set-variable -Wno-psabi -fsigned-char -fno-builtin -Ofast -DNDEBUG
|
CFLAGS += $(ARCH) -MMD -MP -Wall -Wno-unused-variable -Wno-unused-but-set-variable -Wno-psabi -fsigned-char -fno-builtin -Ofast -DNDEBUG
|
||||||
CPPFLAGS := $(CFLAGS) $(CPPFLAGS) -fno-exceptions -fno-rtti -std=c++0x -Wno-write-strings
|
CPPFLAGS := $(CFLAGS) $(CPPFLAGS) -fno-exceptions -fno-rtti -std=c++0x -Wno-write-strings
|
||||||
CFLAGS += -fno-delete-null-pointer-checks -fdata-sections -ffunction-sections -u _printf_float -std=gnu99
|
CFLAGS += -fno-delete-null-pointer-checks -fdata-sections -ffunction-sections -u _printf_float -std=gnu99
|
||||||
|
|
||||||
|
DEPENDS := $(patsubst %.o,%.d,$(OBJS))
|
||||||
|
-include $(DEPENDS)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
|
|
Loading…
Reference in a new issue