X-Git-Url: http://rtime.felk.cvut.cz/gitweb/fpga/virtex2/uart.git/blobdiff_plain/04325406ee353e690bad026b6961ed6331c1ab0d..a24f1edd0b700eb64b3e56835af9a69f926ac0d6:/software/makefile diff --git a/software/makefile b/software/makefile new file mode 100644 index 0000000..ca0bdb8 --- /dev/null +++ b/software/makefile @@ -0,0 +1,55 @@ +# makfile configuration +NAME = ta_uart +OBJECTS = main.o swuart.o fll.o +CPU = msp430x1121 + +ASFLAGS = -mmcu=${CPU} -mforce-hwmul -x assembler-with-cpp -D_GNU_ASSEMBLER_ -c +CFLAGS = -mmcu=${CPU} -mforce-hwmul -O2 -Wall -g + +#switch the compiler (for the internal make rules) +CC = msp430-gcc +AS = msp430-gcc + +.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: ${NAME}.elf ${NAME}.a43 ${NAME}.lst + +#confgigure the next line if you want to use the serial download +download: download-uart +#download: download-jtag +#download: download-bsl + +#additional rules for files +${NAME}.elf: ${OBJECTS} + ${CC} -mmcu=${CPU} -o $@ ${OBJECTS} + +${NAME}.a43: ${NAME}.elf + msp430-objcopy -O ihex $^ $@ + +${NAME}.lst: ${NAME}.elf + msp430-objdump -dSt $^ > $@ + +download-jtag: all + msp430-jtag -e ${NAME}.elf + +download-bsl: all + msp430-bsl -e ${NAME}.elf + +download-uart: all + openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 115200 ${NAME}.elf + +clean: + rm -f ${NAME} ${NAME}.a43 ${NAME}.lst *.o + +#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 +fll.o: fll.s hardware.h +swuart.o: swuart.s hardware.h