]> rtime.felk.cvut.cz Git - fpga/virtex2/uart.git/blob - software/makefile
ca0bdb856044bef82036793c9c836591a1eac97f
[fpga/virtex2/uart.git] / software / makefile
1 # makfile configuration
2 NAME            = ta_uart
3 OBJECTS         = main.o swuart.o fll.o
4 CPU             = msp430x1121
5
6 ASFLAGS         = -mmcu=${CPU} -mforce-hwmul -x assembler-with-cpp -D_GNU_ASSEMBLER_ -c
7 CFLAGS          = -mmcu=${CPU} -mforce-hwmul -O2 -Wall -g
8
9 #switch the compiler (for the internal make rules)
10 CC              = msp430-gcc
11 AS              = msp430-gcc
12
13 .PHONY: all FORCE clean download download-jtag download-bsl dist
14
15 #all should be the first target. it's built when make is runwithout args
16 all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst
17
18 #confgigure the next line if you want to use the serial download
19 download: download-uart
20 #download: download-jtag
21 #download: download-bsl
22
23 #additional rules for files
24 ${NAME}.elf: ${OBJECTS}
25         ${CC} -mmcu=${CPU} -o $@ ${OBJECTS}
26
27 ${NAME}.a43: ${NAME}.elf
28         msp430-objcopy -O ihex $^ $@
29
30 ${NAME}.lst: ${NAME}.elf
31         msp430-objdump -dSt $^ > $@
32
33 download-jtag: all
34         msp430-jtag -e ${NAME}.elf
35
36 download-bsl: all
37         msp430-bsl -e ${NAME}.elf
38
39 download-uart: all
40         openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 115200 ${NAME}.elf
41
42 clean:
43         rm -f ${NAME} ${NAME}.a43 ${NAME}.lst *.o
44
45 #backup archive
46 dist:
47         tar czf dist.tgz *.c *.h *.txt makefile
48
49 #dummy target as dependecy if something has to be build everytime
50 FORCE:
51
52 #project dependencies
53 main.o: main.c hardware.h
54 fll.o: fll.s hardware.h
55 swuart.o: swuart.s hardware.h