2024-05-26 16:10:33 +02:00
|
|
|
-include defs.mak
|
|
|
|
|
2024-05-26 15:35:24 +02:00
|
|
|
SDCC ?= sdcc
|
|
|
|
SDAR ?= sdar
|
|
|
|
STCCODESIZE ?= 8192
|
|
|
|
SDCCOPTS ?=
|
|
|
|
SDCCREV ?= -Dstc15f204ea
|
|
|
|
STCGAL ?= stcgal
|
|
|
|
#/stcgal.py
|
|
|
|
STCGALOPTS ?=
|
|
|
|
STCGALPORT ?= /dev/ttyUSB0
|
|
|
|
STCGALPROT ?= auto
|
|
|
|
FLASHFILE ?= main.ihx
|
|
|
|
|
|
|
|
|
|
|
|
SYSCLK ?= 11059
|
|
|
|
FOSC ?=11059200L
|
|
|
|
CFLAGS ?=
|
|
|
|
|
|
|
|
LIBSRC =
|
|
|
|
|
|
|
|
LIBNAME = mc8051fun/mc8051fun.lib
|
|
|
|
|
|
|
|
PRGSRC = term.c pinsh.c
|
|
|
|
|
|
|
|
PRGOBJ =$(patsubst %.c,%.rel, $(PRGSRC))
|
|
|
|
|
|
|
|
|
|
|
|
$(FLASHFILE): $(LIBNAME) $(PRGOBJ)
|
|
|
|
$(SDCC) -o $(FLASHFILE) $(SDCCOPTS) $(SDCCREV) $(CFLAGS) $(PRGOBJ) $(LIBNAME)
|
|
|
|
|
|
|
|
|
|
|
|
$(LIBNAME): $(LIBOBJ)
|
|
|
|
$(SDAR) -rc $(LIBNAME) $(LIBOBJ)
|
|
|
|
#all:
|
|
|
|
# make uart2.ihx
|
|
|
|
|
|
|
|
%.rel: %.c
|
|
|
|
$(SDCC) $(SDCCOPTS) $(SDCCREV) -DFOSC=$(FOSC) -o $@ -c $<
|
|
|
|
|
|
|
|
eeprom:
|
|
|
|
sed -ne '/:..1/ { s/1/0/2; p }' main.hex > eeprom.hex
|
|
|
|
|
|
|
|
flash: $(FLASHFILE)
|
|
|
|
$(STCGAL) -p $(STCGALPORT) -P $(STCGALPROT) -t $(SYSCLK) $(STCGALOPTS) $(FLASHFILE)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.ihx *.hex *.bin *.rst
|
|
|
|
rm -f *.map
|
|
|
|
rm -f *.rel
|
|
|
|
rm -f *.lst
|
|
|
|
rm -f *.sym
|
|
|
|
rm -f *.asm
|
|
|
|
rm -f *.lk
|
|
|
|
rm -f *.mem
|
|
|
|
rm -f *.lib
|
|
|
|
|
|
|
|
cpp: SDCCOPTS+=-E
|
|
|
|
cpp: main
|