PACKAGE = usb_adc2.bix BIN_PATH = /usr/bin:/usr/local/bin CXX = sdcc AS = asx8051 CPPFLAGS = -V --use-stdout CFLAGS = -V --debug --opt-code-speed --model-small --stack-auto LFLAGS = -V --debug --model-small --xram-loc 0xe000 --xram-size 0x200 --iram-size 0x100 --stack-auto ASFLAGS = -plosgff INCLUDES = -I"c:\program files\sdcc\include" -I../../framework/dependency/EZUSB/include LIBS = -L ../../framework/dependency/EZUSB/lib/fx2 -l ezusb BUILD_DIR = build_by_sdcc HEX2BIX = '/cygdrive/d/Program Files/Cypress/USB/Bin/Hex2bix.exe' SRCS_C = \ fw.c periph.c \ led.c timer.c AD7739.c gps.c LTC1594.c mag.c SRCS_ASM = \ dscr.asm USBJmpTb.asm OBJS = $(SRCS_C:.c=.rel) $(SRCS_ASM:.asm=.rel) all : $(BUILD_DIR) depend $(PACKAGE) # ヘッダーファイルの依存関係 depend: $(SRCS_C) export PATH=$(BIN_PATH):$$PATH; \ rm -f $(BUILD_DIR)/depend.inc; \ for i in $^; do\ $(CXX) -E -MMM $(INCLUDES) $(CPPFLAGS) $$i | sed -e 's/^+.*//g' -e 's/[^\.]*\.rel/$(BUILD_DIR)\/&/g' >> $(BUILD_DIR)/depend.inc;\ done -include $(BUILD_DIR)/depend.inc $(BUILD_DIR)/%.rel : %.c export PATH=$(BIN_PATH):$$PATH; \ $(CXX) -c $(CFLAGS) $(INCLUDES) -o $@ $< $(BUILD_DIR)/%.rel : %.asm export PATH=$(BIN_PATH):$$PATH; \ cp $< $(BUILD_DIR)/; \ cd $(BUILD_DIR); \ $(AS) $(ASFLAGS) $< $(PACKAGE) : $(patsubst %,$(BUILD_DIR)/%,$(PACKAGE)) $(BUILD_DIR)/%.bix : $(BUILD_DIR)/%.hex $(HEX2BIX) $< -O $@ $(BUILD_DIR)/%.hex : $(patsubst %,$(BUILD_DIR)/%,$(OBJS)) export PATH=$(BIN_PATH):$$PATH; \ $(CXX) $(LFLAGS) $(INCLUDES) -o $@ $(LIBS) $^ $(BUILD_DIR) : mkdir $@ clean : rm -f $(PACKAGE) $(BUILD_DIR)/* run : all .PHONY : clean all depend