PACKAGE = usb_adc.bix CFLGS = --opt-code-speed INCLUDE_DIR = ../../framework/dependency/EZUSB/include LIB_DIR = ../../framework/dependency/EZUSB/lib/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_ASM:.asm=.rel) $(SRCS_C:.c=.rel) all : $(BUILD_DIR) $(PACKAGE) $(BUILD_DIR)/%.rel : %.c sdcc -c $(CFLGS) -mmcs51 -DSDCC -I$(INCLUDE_DIR) -o $@ $< $(BUILD_DIR)/%.rel : %.asm cp $< $(BUILD_DIR)/; \ cd $(BUILD_DIR); \ asx8051 -losg $< $(PACKAGE:.bix=.ihx) : $(patsubst %,$(BUILD_DIR)/%,$(OBJS)) sdcc -mmcs51 -o $@ -L$(LIB_DIR) -l ezusb $^ %.hex : %.ihx cp -p $< $@ $(PACKAGE) : $(PACKAGE:.bix=.hex) $(HEX2BIX) $< $(BUILD_DIR) : mkdir $@ clean : rm -f $(PACKAGE) $(BUILD_DIR)/* run : all .PHONY : clean all