-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile.rules.msp430-llvm
30 lines (23 loc) · 977 Bytes
/
Makefile.rules.msp430-llvm
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
LLVM_PATH = /home/pfalcon/projects-3rdparty/llvm-3.0.src/Debug/bin
OPT = $(LLVM_PATH)/opt
LLC = $(LLVM_PATH)/llc
CROSS_COMPILE = msp430-
MCU = msp430g2553
TARGET_FLAGS = -mmcu=$(MCU)
# Can select specific device if multiple connected at the same time,
# format "-s <device_serial>" or "-U <usb_port_id>", see mspdebug --help
DEVICE_SELECT ?=
CLANGFLAGS = -ccc-host-triple msp430 -D__MSP430G2553__ -I/usr/msp430/include -m32 -emit-llvm
OPTFLAGS = -std-compile-opts -strip-debug -disable-simplify-libcalls
LLCFLAGS = -march=msp430
OVERRIDE_RULES = 1
$(TARGETDIR)/%.o: %.cpp
mkdir -p $(TARGETDIR)
clang $(ALL_CXXFLAGS) $(CLANGFLAGS) -S -c $^ -o [email protected]
$(OPT) $(OPTFLAGS) -S [email protected] -f -o [email protected]
$(LLC) $(LLCFLAGS) [email protected] -o [email protected]_
awk '/.globl\tmain/ { print "\t.section\t.init9,\"ax\",@progbits"; } \
{ print }' [email protected]_ > [email protected]
msp430-as [email protected] -o $@
deploy-%: $(TARGETDIR)/%
mspdebug $(DEVICE_SELECT) rf2500 "prog $^"