69 lines
1.5 KiB
Makefile
69 lines
1.5 KiB
Makefile
-include defs.mak
|
|
|
|
|
|
SDCC ?= sdcc
|
|
SDAR ?= sdar
|
|
STCCODESIZE ?= 8192
|
|
SDCCOPTS ?= -mmcs51
|
|
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 uart_send_chr.c uart_send_str.c \
|
|
rotary_encoder_stat.c \
|
|
sevenseg_dec.c sevenseg_dec_inv.c \
|
|
int_to_bcd.c getbutton.c \
|
|
getpin.c setpin_lo.c setpin_hi.c setpin.c getport.c \
|
|
long_xadd.c long_xsub.c long_xset.c long_xrlc.c long_xdiv.c long_xcpy.c long_xtobcd.c \
|
|
multest.c \
|
|
bcd_add.c bcd_getsig.c bcd_invert.c bcd_9cpl.c bcd_addbyte.c bcd_shr.c \
|
|
long_rrc__.c long_rlc__.c \
|
|
long_tobcd__.c long_tobcd.c \
|
|
bcd_tolong__.c bcd_tolong.c \
|
|
long_addbyte__.c long_addbyte.c \
|
|
long_add__.c long_add.c \
|
|
long_1cpl__.c long_invert__.c long_invert.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
|