📄 makefile
字号:
################################################################################ Makefile for the BARE project################################################################################# General FlagsPROJECT = demoTARGET = demoCC=gccOBJCOPY=/cygdrive/c/WinAVR/bin/avr-objcopy## Options common to compile, link and assembly rulesCOMMON =## Compile options common for all C compilation units.CFLAGS = $(COMMON) \ -Iport -I. \ -I../../modbus/rtu -I../../modbus/ascii -I../../modbus/include CFLAGS += -Wall -gstabs -Os -Wall -Wstrict-prototypesCFLAGS += -Wp,-M,-MP,-MT,$(*F).o,-MF,dep/$(@F).d ## Assembly specific flagsASMFLAGS = $(COMMON)ASMFLAGS += -x assembler-with-cpp -Wa,-gstabs## Linker flagsLDFLAGS = $(COMMON)LDFLAGS += -Wl,-Map=$(TARGET).map,--cref## Objects that must be built in order to linkOBJECTS = demo.oMBPORTOBJECTS = port/portserial.o \ port/portevent.o \ port/porttimer.oMBOBJECTS = ../../modbus/mb.o \ ../../modbus/rtu/mbrtu.o \ ../../modbus/rtu/mbcrc.o \ ../../modbus/ascii/mbascii.o \ ../../modbus/functions/mbfunccoils.o \ ../../modbus/functions/mbfuncdiag.o \ ../../modbus/functions/mbfuncholding.o \ ../../modbus/functions/mbfuncinput.o \ ../../modbus/functions/mbfuncother.o \ ../../modbus/functions/mbfuncdisc.o \ ../../modbus/functions/mbutils.o ## Buildall: $(TARGET).elf ## Compiledemo.o: demo.c $(CC) $(INCLUDES) $(CFLAGS) -c $<##Link$(TARGET).elf: $(OBJECTS) $(MBOBJECTS) $(MBPORTOBJECTS) $(CC) $(LDFLAGS) $(OBJECTS) $(MBPORTOBJECTS) $(MBOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET).elf## Clean target.PHONY: cleanclean: -rm -rf $(OBJECTS) $(MBOBJECTS) $(MBPORTOBJECTS) $(TARGET).elf $(TARGET).map## Other dependencies-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -