OpenCores
URL https://opencores.org/ocsvn/openmsp430/openmsp430/trunk

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [xilinx_diligent_s3board/] [software/] [hw_uart/] [makefile] - Blame information for rev 222

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 136 olivier.gi
# makfile configuration
2
NAME            = hw_uart
3 212 olivier.gi
OBJECTS         = main.o cprintf.o
4 136 olivier.gi
 
5 212 olivier.gi
# Compiler performance option (-Os / -O2 / -O3)
6
PORT_CFLAGS     = -O2
7 136 olivier.gi
 
8 212 olivier.gi
# Choose GCC toolchain prefix ('msp430' for MSPGCC / 'msp430-elf' for GCC RedHat/TI)
9
ifndef MSPGCC_PFX
10
MSPGCC_PFX      = msp430-elf
11
endif
12 136 olivier.gi
 
13 212 olivier.gi
# disable some warnings specific to the Dhrystone code
14
WARNINGS        =  -Wall
15 136 olivier.gi
 
16 212 olivier.gi
# Select flags depending on selected toolchain
17
ifeq ($(MSPGCC_PFX),msp430-elf)
18
INCDIR          = -I /cad/ti/gcc/include
19
CFLAGS          = -D PFX_MSP430_ELF $(INCDIR) $(PORT_CFLAGS) ${WARNINGS} -g -mcpu=msp430 -mhwmult=16bit
20
else
21
CFLAGS          = -D PFX_MSP430               $(PORT_CFLAGS) ${WARNINGS} -g -mcpu=430    -mmpy=16       -mivcnt=16
22
endif
23
 
24
# Toolchain executables
25
CC              = ${MSPGCC_PFX}-gcc
26
OBJCOPY         = ${MSPGCC_PFX}-objcopy
27
OBJDUMP         = ${MSPGCC_PFX}-objdump
28
OBJSIZE         = ${MSPGCC_PFX}-size
29
 
30
 
31
.PHONY: all FORCE clean download dist
32
 
33 136 olivier.gi
#all should be the first target. it's built when make is runwithout args
34 212 olivier.gi
all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${NAME}.size
35 136 olivier.gi
 
36
#confgigure the next line if you want to use the serial download
37
download: download-uart
38
 
39
#additional rules for files
40
${NAME}.elf: ${OBJECTS}
41 212 olivier.gi
        ${CC} ${CFLAGS} -T linker.${MSPGCC_PFX}.x -o $@ ${OBJECTS}
42 136 olivier.gi
 
43
${NAME}.a43: ${NAME}.elf
44 212 olivier.gi
        ${OBJCOPY} -O ihex $^ $@
45 136 olivier.gi
 
46
${NAME}.lst: ${NAME}.elf
47 212 olivier.gi
        ${OBJDUMP} -dSt $^ >$@
48 136 olivier.gi
 
49 212 olivier.gi
${NAME}.size: ${NAME}.elf
50
        ${OBJSIZE}  $^ >$@
51 136 olivier.gi
 
52
download-uart: all
53
        openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 115200 ${NAME}.elf
54
 
55
clean:
56 212 olivier.gi
        rm -f ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${NAME}.size *.o
57 136 olivier.gi
 
58
#backup archive
59
dist:
60
        tar czf dist.tgz *.c *.h *.txt makefile
61
 
62
#dummy target as dependecy if something has to be build everytime
63
FORCE:
64
 
65
#project dependencies
66
main.o: main.c hardware.h
67 212 olivier.gi
cprintf.o: cprintf.c cprintf.h

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.