-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (21 loc) · 814 Bytes
/
Makefile
File metadata and controls
29 lines (21 loc) · 814 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
SDCC=sdcc
SDLD=sdld
CFLAGS=--std-sdcc99 --opt-code-speed -DSTM8
MFLAGS=-mstm8
LDFLAGS=-lstm8 --out-fmt-ihx
INC=-I. -Ilib -Imculib
STM8FLASH=~/Programy/stm8flash/stm8flash
SOURCES=firmware.c mculib/usart.c mculib/spi.c mculib/nrf.c mculib/delay.c mculib/circular.c lib/print.c lib/ppp.c lib/network.c modes/cities.c
OBJECTS=$(SOURCES:.c=.rel)
OBJECT=firmware
.PHONY: all clean flash
all: $(OBJECT).ihx
clean:
rm -f $(OBJECTS) $(OBJECT).ihx \
$(SOURCES:.c=.rel) $(SOURCES:.c=.rst) $(SOURCES:.c=.sym) $(SOURCES:.c=.lst) $(SOURCES:.c=.cdb) $(SOURCES:.c=.map) $(SOURCES:.c=.lk)
flash: $(OBJECT).ihx
$(STM8FLASH) -c stlinkv2 -p stm8s103?3 -s flash -w $(OBJECT).ihx
%.ihx: $(OBJECTS)
$(SDCC) $(MFLAGS) $(LDFLAGS) $^ -o $@
%.rel: %.c
$(SDCC) -c $(INC) $(CFLAGS) $(MFLAGS) -DMY_ID=$(ID) -D$(DEVICE) $< -o $@