From 27403e05947eda894555a7c85eeb4739f2aa2b38 Mon Sep 17 00:00:00 2001 From: Daniel Schulte Date: Sat, 12 May 2018 12:12:52 +0200 Subject: [PATCH 1/2] Makefile: Don't fail if build dir already exists --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b71a8c7..da5e523 100644 --- a/Makefile +++ b/Makefile @@ -152,7 +152,7 @@ $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) $(BIN) $< $@ $(BUILD_DIR): - mkdir $@ + mkdir -p $@ format: find Src/ Inc/ -iname '*.h' -o -iname '*.c' | xargs clang-format -i From 792e7a9e9b72ddeff3d0fd40e4eb01e0b2c9df90 Mon Sep 17 00:00:00 2001 From: Daniel Schulte Date: Sat, 12 May 2018 12:13:43 +0200 Subject: [PATCH 2/2] Makefile: Rebuild objects if config.h changes --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index da5e523..832aab5 100644 --- a/Makefile +++ b/Makefile @@ -135,10 +135,10 @@ vpath %.c $(sort $(dir $(C_SOURCES))) OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) vpath %.s $(sort $(dir $(ASM_SOURCES))) -$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) +$(BUILD_DIR)/%.o: %.c Inc/config.h Makefile | $(BUILD_DIR) $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ -$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) +$(BUILD_DIR)/%.o: %.s Inc/config.h Makefile | $(BUILD_DIR) $(AS) -c $(CFLAGS) $< -o $@ $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile