# makfile configuration TARGET = RZM CSOURCES = main.c spi_hardware.c OBJECTS = ${CSOURCES:.c=.o} MCU = msp430f2274 CPU = 430 MPLIER = none CFLAGS = -mmcu=${MCU} -g -O2 -Wall -Wno-pointer-sign -Wno-unused-variable -Wno-unused-but-set-variable LDFLAGS = -mmcu=$(MCU) -Wl,-Map=$(TARGET).map #CFLAGS = -mmcu=$(CHIP) -mmpy=${MPLIER} -mcpu=${CPU} -g -O2 -Wall #switch the compiler (for the internal make rules) CC = msp430-gcc LD = msp430-ld AR = msp430-ar AS = msp430-gcc GASP = msp430-gasp NM = msp430-nm OBJCOPY = msp430-objcopy RANLIB = msp430-ranlib STRIP = msp430-strip SIZE = msp430-size READELF = msp430-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 $@ echo echo ">>>> Size of Firmware <<<<" $(SIZE) $(TARGET).elf echo ${TARGET}.a43: ${TARGET}.elf msp430-objcopy -O ihex $^ $@ ${TARGET}.lst: ${TARGET}.elf msp430-objdump -dSt $^ >$@ 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