Skip to content

Commit bc63e6a

Browse files
draccUltrawipf
authored andcommitted
Makefile cleanup
1 parent 07ee4c6 commit bc63e6a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Firmware/Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ BUILD_DIR = build
2626
######################################
2727

2828
# Choose your board mcu F407VG or F411RE
29-
MCU_TARGET=F407VG
29+
MCU_TARGET ?= F407VG
3030
# The directory of mcu target
3131
TARGET_DIR = Targets/$(MCU_TARGET)
3232

@@ -36,7 +36,7 @@ TARGET_DIR = Targets/$(MCU_TARGET)
3636
TARGET = OpenFFBoard_$(MCU_TARGET)
3737

3838
# Output directory for hex/bin files
39-
OUTPUT_DIR = $(BUILD_DIR)
39+
OUTPUT_DIR ?= $(BUILD_DIR)
4040

4141
# C sources
4242
C_SOURCES = $(wildcard $(TARGET_DIR)/Core/Src/*.c)
@@ -229,15 +229,15 @@ $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
229229

230230
$(OUTPUT_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(OUTPUT_DIR)
231231
$(HEX) $< $@
232-
232+
233233
$(OUTPUT_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(OUTPUT_DIR)
234-
$(BIN) $< $@
235-
234+
$(BIN) $< $@
235+
236236
$(BUILD_DIR):
237-
-mkdir $@
238-
237+
-mkdir -p $@
238+
239239
$(OUTPUT_DIR): $(BUILD_DIR)
240-
-mkdir $@
240+
-mkdir -p $@
241241

242242
#######################################
243243
# clean up
@@ -256,4 +256,4 @@ upload: $(BUILD_DIR)/$(TARGET).bin
256256
#######################################
257257
-include $(wildcard $(BUILD_DIR)/*.d)
258258

259-
# *** EOF ***
259+
# *** EOF ***

0 commit comments

Comments
 (0)