-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
53 lines (35 loc) · 1.62 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
52
53
#
# Makefile for a rephone sample under Linux
#
# https://github.com/mandl/LinkIt_Assist_2502
#
# Set your path to gcc-arm-none-eabi-4_9-2014q4
TOOLCHAIN=~/gcc-arm-none-eabi-4_9-2014q4
# Set your LinkIt sdk path
LINKIT_ASSIST_SDK_PATH=/home/mandl/Entwicklung
CC=$(TOOLCHAIN)/bin/arm-none-eabi-gcc
AS=$(TOOLCHAIN)/bin/arm-none-eabi-as
LD=$(TOOLCHAIN)/bin/arm-none-eabi-gcc
OBJCOPY=$(TOOLCHAIN)/bin/arm-none-eabi-objcopy
INCLUDE=-I$(LINKIT_ASSIST_SDK_PATH)/LINKIT_ASSIST_SDK/include -I./2502A_DigitalClock/ResID -I./2502A_DigitalClock
#flags
CFLAGS = -mthumb-interwork -c -gdwarf-2 -gstrict-dwarf -fpic -mcpu=arm7tdmi-s -fvisibility=hidden -mthumb -mlittle-endian -O2 -D__COMPILER_GCC__ -D__HDK_LINKIT_ASSIST_2502__ -fno-exceptions -fno-non-call-exceptions $(INCLUDE)
ASFLAGS =
BASENAME = main
ELFFILE = $(BASENAME).elf
AXF = $(BASENAME).axf
VXP = $(BASENAME).vxp
LSCRIPT = $(LINKIT_ASSIST_SDK_PATH)/LINKIT_ASSIST_SDK/lib/LINKIT10/armgcc/scat.ld
TARGETS = $(ELFFILE) $(AXF)
OBJS = ./2502A_DigitalClock/DigitalClock.o ./2502A_DigitalClock/lcd_sitronix_st7789s.o $(LINKIT_ASSIST_SDK_PATH)/LINKIT_ASSIST_SDK/lib/LINKIT10/src/gccmain.o
all:$(TARGETS)
$(ELFFILE): $(OBJS) Makefile
$(CC) -o $(ELFFILE) $(OBJS) -T $(LSCRIPT) -Wl,--gc-sections -fpic -pie --specs=nosys.specs -B $(TOOLCHAIN)/arm-none-eabi/lib/thumb $(LINKIT_ASSIST_SDK_PATH)/LINKIT_ASSIST_SDK/lib/LINKIT10/armgcc/percommon.a
$(AXF): $(ELFFILE)
$(OBJCOPY) -g -R .comment $(ELFFILE) $(AXF)
$(OBJCOPY) --only-keep-debug $(ELFFILE) $(BASENAME)dbg.axf
./merge_mtk.py $(AXF) $(VXP)
clean:
rm -f *.o *.lst *.map *.axf *.vxp *.elf $(OBJS)
upload:$(TARGETS)
./uploader.py