From 08477b5f832d0645bd720765340218823ae8e478 Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Fri, 17 May 2024 23:49:38 +0200 Subject: [PATCH] Initial commit --- Makefile | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2f9f053 --- /dev/null +++ b/Makefile @@ -0,0 +1,51 @@ +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 +SYSCLK ?= 11056 +FOSC ?=11056000L +CFLAGS ?= -DWITH_ALT_LED9 -DWITHOUT_LEDTABLE_RELOC -DSHOW_TEMP_DATE_WEEKDAY + +LIBSRC = uart_init.c + +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