我目前正在使用minGW和conemu控制台构建基于msp430 gcc的c plus plus程序。 SUPPORT_FILE_DIRECTORY =“/ c / ti / msp430_gcc / include”
SOURCES=blink.cpp
OBJECTS=$(SOURCES:.cpp=.o)
DEVICE = msp430g2553
CC = msp430-elf-gcc
GDB = msp430-elf-gdb
CFLAGS = -I $(SUPPORT_FILE_DIRECTORY) -mmcu=$(DEVICE) -O2 -g
LFLAGS = -L $(SUPPORT_FILE_DIRECTORY)
all: ${OBJECTS}
$(CC) $(SOURCES) $(CFLAGS) $(LFLAGS) -o $(DEVICE).out
clean:
rm $(OBJECTS)
如果我只使用print进行make,我总会得到以下输出
$ make --just-print
g++ -c -o blink.o blink.cpp
msp430-elf-gcc blink.cpp -I "/c/ti/msp430_gcc/include" -mmcu=msp430g2553 -O2 -g -L "/c/ti/msp430_gcc/include" -o msp430g2553.out
实际make失败并出现以下错误
g++ -c -o blink.o blink.cpp
blink.cpp:21:20: fatal error: msp430.h: No such file or directory
#include <msp430.h>
^
compilation terminated.
mingw32-make: *** [<builtin>: blink.o] Error 1
进行了额外的观察,如果目标文件已经存在,则不会发生此错误。