comma:= , empty:= space:= $(empty) $(empty) bracketl:= ( bracketl0:= \( bracketr:= ) bracketr0:= \) OUTDIR = output ROOT_PATH = c:\keil UTIL_PATH = /home/ast/vol/work/util/ C51BIN = $(ROOT_PATH)\C51\BIN C51 = $(C51BIN)\c51 A51 = $(C51BIN)\ax51 BL51 = $(C51BIN)\lx51 OH51 = $(C51BIN)\ohx51 OC51 = $(C51BIN)\oc51 LIB51 = $(C51BIN)\lib51 TARGET = $(OUTDIR)\fw TARGETHEX = $(TARGET).hex OPT_LEVEL=8 LIST_FILE_CTL=PR($(@:obj=lst)) C_OPTS = object($@) OBJECTADVANCED browse $(LIST_FILE_CTL) \ OT($(OPT_LEVEL),SPEED) #ASM_OPTS = $(LIST_FILE_CTL) object($@) ASM_OPTS = SET (small) DEBUG EP $(LIST_FILE_CTL) object($@) LINK_OPTS = \ SEGMENTS(\ ?STACK(D:0xD0))\ NOOVERLAY \ PAGELENGTH(60000) \ CODE LINK_OBJ = main packet uart1 usb0 usb0_desc uart0 sdio LINK_OBJ_TMP = $(addsuffix .obj,$(LINK_OBJ)) LINK_OBJ_DEPENDENCIES = $(addprefix $(OUTDIR)/, $(LINK_OBJ_TMP)) LINK_OBJ_FILES = $(subst $(space),$(comma),$(LINK_OBJ_DEPENDENCIES)) .SUFFIXES: .a51 $(OUTDIR)/%.obj : %.c $(C51) $< "$(C_OPTS)" $(OUTDIR)/%.obj : %.a51 $(A51) $< "$(ASM_OPTS)" all : $(TARGETHEX) e.exe e : regedr.c gcc $^ -g -o $@ e.exe : regedr.c gcc $^ -o $@ -lhid -lsetupapi geneep : geneep.c gcc $^ -g -o $@ cp geneep.exe ../rom/util/ geneep.exe : geneep.c gcc $^ -o $@ $(TARGET) : $(LINK_OBJ_DEPENDENCIES) $(BL51) "$(LINK_OBJ_FILES) TO $@ $(LINK_OPTS)" $(TARGETHEX) : $(TARGET) $(OH51) $(TARGET) clean: rm e $(OUTDIR)/* cleanwin: del e.exe del /Q $(OUTDIR)\*.* ttt : echo $(ASM_OPTS_CYGWIN)