2024-05-17 23:49:38 +02:00
|
|
|
SDCC ?= sdcc
|
|
|
|
SDAR ?= sdar
|
|
|
|
STCCODESIZE ?= 8192
|
|
|
|
SDCCOPTS ?= -mmcs51 --iram-size 512 --code-size $(STCCODESIZE) --xram-size 0 --opt-code-size --stack-auto
|
|
|
|
SDCCREV ?= -Dstc15f204ea
|
|
|
|
STCGAL ?= stcgal
|
|
|
|
#/stcgal.py
|
|
|
|
STCGALOPTS ?=
|
|
|
|
STCGALPORT ?= /dev/ttyUSB0
|
|
|
|
STCGALPROT ?= auto
|
|
|
|
FLASHFILE ?= main.ihx
|
2024-05-23 22:48:41 +02:00
|
|
|
#SYSCLK ?= 11056
|
|
|
|
#FOSC ?=11056000L
|
2024-05-17 23:49:38 +02:00
|
|
|
CFLAGS ?= -DWITH_ALT_LED9 -DWITHOUT_LEDTABLE_RELOC -DSHOW_TEMP_DATE_WEEKDAY
|
|
|
|
|
2024-05-19 01:00:30 +02:00
|
|
|
LIBSRC = uart_init.c uart_send_chr.c uart_send_str.c \
|
|
|
|
rotary_encoder_stat.c \
|
2024-05-19 21:02:50 +02:00
|
|
|
sevenseg_dec.c sevenseg_dec_inv.c \
|
2024-05-23 22:48:41 +02:00
|
|
|
int_to_bcd.c getbutton.c
|
2024-05-17 23:49:38 +02:00
|
|
|
|
|
|
|
LIBOBJ =$(patsubst %.c,%.rel, $(LIBSRC))
|
|
|
|
LIBNAME=mc8051fun.lib
|
|
|
|
|
|
|
|
|
|
|
|
PRGOBJ =$(patsubst %.c,%.rel, $(PRGSRC))
|
|
|
|
|
|
|
|
|
|
|
|
$(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
|