blob: 8d3647d31e8592d49fbdd1e5520e6ad9253480ca (
plain)
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
|
# vim:ft=make
CPU = 430x
MCU = msp430fr5969
INCLUDES += -Iinclude/msp430fr5969lp -I/opt/msp430/ti/gcc/include
COMMON_FLAGS += -mcpu=${CPU} -mmcu=${MCU}
CC = /opt/msp430/ti/gcc/bin/msp430-elf-gcc
CXX = /opt/msp430/ti/gcc/bin/msp430-elf-g++
OBJCOPY = /opt/msp430/ti/gcc/bin/msp430-elf-objcopy
TARGETS += src/arch/msp430fr5969lp/arch.cc
TARGETS += src/arch/msp430fr5969lp/driver/adc.cc
TARGETS += src/arch/msp430fr5969lp/driver/gpio.cc
TARGETS += src/arch/msp430fr5969lp/driver/stdout.cc
TARGETS += src/arch/msp430fr5969lp/driver/uptime.cc
TARGETS += src/arch/msp430fr5969lp/driver/i2c.cc
OBJECTS = ${TARGETS:.cc=.o}
.cc.o:
${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} -c -o $@ ${@:.o=.cc}
build/system.elf: ${OBJECTS}
${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} \
-Wl,--library-path=/opt/msp430/ti/gcc/include/ \
-flto -o $@ ${OBJECTS}
build/system.hex: build/system.elf
${OBJCOPY} -O ihex ${@:.hex=.elf} $@
program: build/system.hex
LD_LIBRARY_PATH=/home/derf/var/projects/msp430/MSP430Flasher_1.3.7 \
/home/derf/var/projects/msp430/MSP430Flasher_1.3.7/MSP430Flasher \
-w build/system.hex -v -g -z '[VCC]'
arch_clean:
rm -f ${OBJECTS}
rm -f build/system.hex
monitor:
screen /dev/ttyACM1 115200
.PHONY: arch_clean monitor program
|