-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (46 loc) · 1.23 KB
/
Makefile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#############################
# Make file for NUCLEO-8S207K8 board
#############################
BOARD=stm8s207k8
PROGRAMMER=stlinkv21
FLASH_SIZE=65536
BOARD_INC=../inc/stm8s207.inc ../inc/nucleo_8s207.inc
NAME=stm8_wozmon
SDAS=sdasstm8
SDCC=sdcc
OBJCPY=objcpy
CFLAGS=-mstm8 -lstm8 -L$(LIB_PATH) -I../inc
INC=../inc/
INCLUDES=$(BOARD_INC) $(INC)ascii.inc $(INC)gen_macros.inc
BUILD=build/
SRC=stm8_wozmon.asm
OBJECT=$(BUILD)$(BOARD)/$(NAME).rel
OBJECTS=$(BUILD)$(BOARD)/$(SRC:.asm=.rel)
LIST=$(BUILD)$(BOARD)/$(NAME).lst
FLASH=stm8flash
.PHONY: all
all: clean asm #flash
asm:
#
# "*************************************"
# "compiling $(NAME) for $(BOARD) "
# "*************************************"
$(SDAS) -g -l -o $(BUILD)$(BOARD)/$(NAME).rel $(SRC)
$(SDCC) $(CFLAGS) -Wl-u -o $(BUILD)$(BOARD)/$(NAME).ihx $(OBJECT)
objcopy -Iihex -Obinary $(BUILD)$(BOARD)/$(NAME).ihx $(BUILD)$(BOARD)/$(NAME).bin
#
@ls -l $(BUILD)$(BOARD)/$(NAME).bin
#
.PHONY: clean
clean:
#
# "***************"
# "cleaning files"
# "***************"
rm -f $(BUILD)$(BOARD)/*
flash: $(LIB)
#
# "******************"
# "flashing $(BOARD) "
# "******************"
$(FLASH) -c $(PROGRAMMER) -p $(BOARD) -s flash -w $(BUILD)$(BOARD)/$(NAME).ihx