📄 makefile
字号:
all: ev28051.hex
HEADERS := test.h cnmutil.h cnmibvar.h hostport.h audio.h error.h cm1_funcs.h host_reg.h mystrings.h
HEADERS := $(HEADERS) evif.h cm2_funcs.h packet.h mib.h query.h led.h serial.h command.h hmi.h
# It is wierd that -Ofilename option does not work
# So, use audio.hex as output, then copy it to the destination
DEST_PATH = c:\projects\cobraline\c_code
AUX_PATH = c:\projects\cobraline\vb
COMPILER_PATH = c:\ht-8051\bin
OUT_AUDIO = cnmutil
OBJS := $(OUT_AUDIO).obj test.obj audio.obj hostport.obj error.obj cm1_funcs.obj cm2_funcs.obj cnmibvar.obj mibvars.obj
OBJS := $(OBJS) evif.obj host_reg.obj packet.obj mib.obj query.obj led.obj serial.obj command.obj hmi.obj main.obj mystrings.obj
# -AAHEX generate HEX file
# -Bl use large memory model
# -C compile to object file
# -E use editor format for compile errors
# -PSECTMAP display complete memory usage
# -S compile to assembler code
# -V Verbose
# -W set warning level
# -Zg global optimization
FLAGS = -P89C51RD2HXX -RAM400-7FFF -Bl -V -Mtemp
C_FLAGS = $(FLAGS) -C -E -W0 -ASMLIST -O -AAHEX -Zg -AV
L_FLAGS = $(FLAGS) -L-Pmibvars=a800h -L-Pmibstruct=b800h -L-Pmystrings=9400h
CC = $(COMPILER_PATH)\C51
LINK = $(CC) # Link and compile use the same command
#link command
ev28051.hex : $(OBJS)
$(LINK) $(L_FLAGS) $(OBJS)
copy $(OUT_AUDIO).hex $(DEST_PATH)\$@
copy $(OUT_AUDIO).hex $(AUX_PATH)\$@
# compile command
$(OBJS): %.obj : %.c $(HEADERS)
$(CC) $(C_FLAGS) -M$(patsubst %.c,%,$<) -S $<
$(CC) $(C_FLAGS) -M$(patsubst %.c,%,$<) $(patsubst %.c,%.as,$<)
.PHONY: clean
clean:
rm $(patsubst %.obj,%.as,$(OBJS)) $(OBJS)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -