📄 makefile
字号:
# makefile configuration
OUTPUT_DIR = bin
NAME = ccfatlib
OBJECTS = main.o halayer.o fatlib.o
CPU = msp430x449
CFLAGS = -mmcu=${CPU} -O2 -Wall -g
#switch the compiler (for the internal make rules)
CC = msp430-gcc
LD=msp430-ld
.PHONY: all FORCE clean download download-jtag download-bsl dist
#all should be the first target. it's built when make is run without args
all: ${NAME}.elf ${NAME}.a43 # ${NAME}.lst
rm -f main.o
#additional rules for files
${NAME}.elf: ${OBJECTS}
${CC} -mmcu=${CPU} -Wl,-Map=${NAME}.map -o $@ ${OBJECTS}
${NAME}.a43: ${NAME}.elf
msp430-objcopy -O ihex $^ $@
${NAME}.lst: ${NAME}.elf
msp430-objdump -dSt $^ >$@
# How to make listings (with assembly code):
%.lst: %.o
msp430-objdump -DS $^ > $@
# GNU make contains a built-in implicit rule for making .o files from .c files.
clean:
rm -f ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${OBJECTS}
#backup archive
dist:
tar czf dist.tgz *.c *.h *.txt makefile
#dummy target as dependecy if something has to be build everytime
FORCE:
#project dependencies
-include dependencies.in
#target to update the file, it's removed first
depend: rmdepend dependencies.in
#remove the file
rmdepend:
rm -f dependencies.in
#build the file that contains the dependencies. no deps in this rule.
#if there were deps it would be rebuilt every chnage, which is unneded:
dependencies.in:
$(CC) -MM ${CFLAGS} $(patsubst %.o,%.c,$(OBJECTS)) >$@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -