forked from DeqingSun/ch55xduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (20 loc) · 650 Bytes
/
Makefile
File metadata and controls
30 lines (20 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
SDCCBASE=/opt/sdcc
BINDIR=$(SDCCBASE)/bin
SDCC=$(BINDIR)/sdcc
SDLD=$(BINDIR)/sdld
OBJECT=uart
OBJECTS=uart-int.rel
LIBDIR=../../STM8S_StdPeriph_Driver/src
#LIBFILES=$(LIBDIR)/stm8s_gpio.rel
LIBFILES=$(LIBDIR)/stm8s.lib
CFLAGS=-DSTM8S103 -I. -I../../STM8S_StdPeriph_Driver/inc --debug
.PHONY: all clean flash
all: $(OBJECT).ihx
clean:
rm -f *.asm *.ihx *.rel *.sym *.map *.cdb *.lk *.lst *.rst *~
flash: $(OBJECT).ihx
stm8flash -cstlinkv2 -pstm8s103?3 -w $(OBJECT).ihx
$(OBJECT).ihx: $(OBJECTS) $(LIBFILES)
$(SDCC) -lstm8 -mstm8 --out-fmt-ihx $(LDFLAGS) $^ -o $@
%.rel: %.c
$(SDCC) -lstm8 -mstm8 --out-fmt-ihx $(CFLAGS) $(LDFLAGS) -c $<