Only support building a single board at a time

As a follow up to c461e20df3 ("make: Remove version from build output
path"), only support building a single version of a single board by
default. The build directory can still be specified by passing `BUILD`.

Fixes running the `clean` target when `BUILD` is a custom value or
`BOARD` isn't set.

Fixes: b03c960b4f ("make: Reduce build output")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2023-10-12 12:36:53 -06:00
committed by Tim Crawford
parent 946415f3a7
commit 01be30f107
5 changed files with 20 additions and 21 deletions

View File

@@ -22,25 +22,25 @@ sim: $(BUILD)/ec.elf
# Convert from Intel Hex file to binary file
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
@echo " OBJCOPY $(subst $(obj)/,,$@)"
@echo " OBJCOPY $(subst $(BUILD)/,,$@)"
mkdir -p $(@D)
$(OBJCOPY) -I ihex -O binary --gap-fill 0xFF $< $@
# Convert from ELF file to Intel Hex file
$(BUILD)/ec.ihx: $(BUILD)/ec.elf
@echo " OBJCOPY $(subst $(obj)/,,$@)"
@echo " OBJCOPY $(subst $(BUILD)/,,$@)"
mkdir -p $(@D)
$(OBJCOPY) -j .text -j .data -O ihex $< $@
# Link object files into ELF file
$(BUILD)/ec.elf: $(OBJ)
@echo " LINK $(subst $(obj)/,,$@)"
@echo " LINK $(subst $(BUILD)/,,$@)"
mkdir -p $(@D)
$(CC) -o $@ $^
# Compile C files into object files
$(BUILD)/%.o: src/%.c $(INCLUDE)
@echo " CC $(subst $(obj)/,,$@)"
@echo " CC $(subst $(BUILD)/,,$@)"
mkdir -p $(@D)
$(CC) $(CFLAGS) -o $@ -c $<