加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile.rules.msp430-llvm 977 Bytes
一键复制 编辑 原始数据 按行查看 历史
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 $@.ll
$(OPT) $(OPTFLAGS) -S $@.ll -f -o $@.opt.ll
$(LLC) $(LLCFLAGS) $@.opt.ll -o $@.opt.s_
awk '/.globl\tmain/ { print "\t.section\t.init9,\"ax\",@progbits"; } \
{ print }' $@.opt.s_ > $@.opt.s
msp430-as $@.opt.s -o $@
deploy-%: $(TARGETDIR)/%
mspdebug $(DEVICE_SELECT) rf2500 "prog $^"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化