Prepare for portable build process

This commit is contained in:
Jeremy Soller
2019-09-29 16:45:12 -06:00
parent af0a5f623f
commit 608326af30
4 changed files with 57 additions and 20 deletions

25
src/arch/8051/arch.mk Normal file
View File

@ -0,0 +1,25 @@
CC=sdcc -mmcs51
OBJ=$(patsubst src/%.c,$(BUILD)/%.rel,$(SRC))
# Run EC rom in simulator
sim: $(BUILD)/ec.rom
cargo run \
--release \
--manifest-path ecsim/Cargo.toml \
--no-default-features \
-- $<
# Convert from Intel Hex format to binary
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
@mkdir -p $(@D)
makebin -p < $< > $@
# Link object files into Intel Hex format
$(BUILD)/ec.ihx: $(OBJ)
@mkdir -p $(@D)
$(CC) -o $@ $^
# Compile C files into object files
$(BUILD)/%.rel: src/%.c $(INCLUDE)
@mkdir -p $(@D)
$(CC) -o $@ -c $<