Make make rebuild on header changes

This commit is contained in:
Sijmen 2020-12-10 23:53:16 +01:00
parent a67d2a1945
commit 1cabaf2b04
Signed by: vijfhoek
GPG Key ID: DAF7821E067D9C48
3 changed files with 8 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
*.o
*.a
*.d
*.elf
*.img
*.lst

View File

@ -19,7 +19,7 @@ all: $(TARGET)
$(TARGET): $(OBJS) $(LIBS)
@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)objcopy $(TARGET).elf -O binary $(TARGET).img

View File

@ -12,6 +12,7 @@ PREFIX ?= arm-none-eabi-
CC = $(PREFIX)gcc
CPP = $(PREFIX)g++
CXX = $(PREFIX)g++
AS = $(CC)
LD = $(PREFIX)ld
AR = $(PREFIX)ar
@ -39,10 +40,13 @@ else
endif
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
CFLAGS += -fno-delete-null-pointer-checks -fdata-sections -ffunction-sections -u _printf_float -std=gnu99
DEPENDS := $(patsubst %.o,%.d,$(OBJS))
-include $(DEPENDS)
.PHONY: clean
%.o: %.S