# makfile configuration TARGET = rf_mon CSOURCES = main.c spi_hardware.c OBJECTS = ${CSOURCES:.c=.o} MCU = MSP430F2274 #CPU = 430 #MPLIER = none CFLAGS = -I c:\msp430-gcc\include -mmcu=${MCU} -g -O2 -Wall -Wno-pointer-sign -Wno-unused-variable -Wno-unused-but-set-variable #LFLAGS = -L $(SUPPORT_FILE_DIRECTORY) -Wl,-Map,$(MAP),--gc-sections LDFLAGS = -L c:\msp430-gcc\include -Wl,-Map,$(TARGET).map,--gc-sections #CFLAGS = -mmcu=$(CHIP) -mmpy=${MPLIER} -mcpu=${CPU} -g -O2 -Wall #switch the compiler (for the internal make rules) CC = msp430-elf-gcc LD = msp430-elf-ld AR = msp430-elf-ar AS = msp430-elf-gcc GASP = msp430-elf-gasp GDB = msp430-elf-gdb NM = msp430-elf-nm OBJCOPY = msp430-elf-objcopy OBJDUMP = msp430-elf-objdump RANLIB = msp430-elf-ranlib STRIP = msp430-elf-strip SIZE = msp430-elf-size READELF = msp430-elf-readelf MAKETXT = srec_cat CP = copy RM = del MV = move .PHONY: all FORCE clean download download-jtag download-bsl dist #all should be the first target. it's built when make is runwithout args all: ${TARGET}.elf ${TARGET}.a43 ${TARGET}.lst #confgigure the next line if you want to use the serial download #download: download-debug #download: download-bsl #additional rules for files ${TARGET}.elf: ${OBJECTS} echo "Linking $@" # $(CC) $(OBJECTS) $(LDFLAGS) $? $(LIBS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ # $(CC) $(OBJECTS) $(LDFLAGS) $? -o $(MCU).out echo echo ">>>> Size of Firmware <<<<" $(SIZE) $(TARGET).elf echo ${TARGET}.a43: ${TARGET}.elf $(OBJCOPY) -O ihex $^ $@ ${TARGET}.lst: ${TARGET}.elf $(OBJDUMP) -dSt $^ >$@ debug: all $(GDB) ${TARGET}.elf -ex "target remote :55000" download-jtag: all msp430-jtag --spy-bi-wire -lTIUSB -e ${TARGET}.elf download-debug: all mspdebug RF2500 "prog ${TARGET}.elf" download-bsl: all msp430-bsl -e ${TARGET}.elf clean: del ${TARGET}.elf ${TARGET}.a43 ${TARGET}.lst ${OBJECTS} #backup archive dist: tar czf dist.tgz *.c *.h *.txt makefile #dummy target as dependecy if something has to be build everytime FORCE: #project dependencies main.o: main.c hardware.h spi_hardware.c cc_regs.h rf_settings.h spi_hardware.h -include $(OBJS:.o=.d)