stc_rpncalc/Makefile
Jeff Wang d351995294 initial decimal number code, needs work
- need to change to have implicit decimal point after first digit
- need to rework for code size
2019-03-22 16:38:35 -04:00

31 lines
616 B
Makefile

SDCC ?= sdcc
STCCODESIZE ?= 13000
SDCCOPTS ?= --code-size $(STCCODESIZE) --xram-size 0 --stack-auto
FLASHFILE ?= main.hex
SRC = src/lcd.c src/key.c src/utils.c src/decn/decn.c
OBJ=$(patsubst src%.c,build%.rel, $(SRC))
all: main
build/%.rel: src/%.c src/%.h
mkdir -p $(dir $@)
$(SDCC) $(SDCCOPTS) -o $@ -c $<
main: $(OBJ)
$(SDCC) -o build/ src/$@.c $(SDCCOPTS) $(CFLAGS) $^
@ tail -n 5 build/main.mem | head -n 2
@ tail -n 1 build/main.mem
cp build/$@.ihx $@.hex
eeprom:
sed -ne '/:..1/ { s/1/0/2; p }' main.hex > eeprom.hex
clean:
rm -f *.ihx *.hex *.bin
rm -rf build/*
cpp: SDCCOPTS+=-E
cpp: main