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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [altera_de0_nano_soc/] [software/] [apps/] [leds/] [makefile] - Blame information for rev 221

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 221 olivier.gi
# makfile configuration
2
NAME            = leds
3
OBJECTS         = main.o ../../libs/tA/timerA.o
4
 
5
# Compiler performance option (-Os / -O2 / -O3)
6
PORT_CFLAGS     = -O2
7
 
8
# 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
 
13
# disable some warnings specific to the Dhrystone code
14
WARNINGS        =  -Wall
15
 
16
# Select flags depending on selected toolchain
17
ifeq ($(MSPGCC_PFX),msp430-elf)
18
INCDIR          = -I /cad/ti/gcc/include -I ../../libs -I ../../libs/tA  -I ../../libs/gfx
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
.PHONY: all FORCE clean download dist
31
 
32
#all should be the first target. it's built when make is runwithout args
33
all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${NAME}.size
34
 
35
#confgigure the next line if you want to use the serial download
36
download: download-uart
37
 
38
#additional rules for files
39
${NAME}.elf: ${OBJECTS}
40
        ${CC} ${CFLAGS} -T ../../ldscripts/linker.${MSPGCC_PFX}.x -o $@ ${OBJECTS}
41
 
42
${NAME}.a43: ${NAME}.elf
43
        ${OBJCOPY} -O ihex $^ $@
44
 
45
${NAME}.lst: ${NAME}.elf
46
        ${OBJDUMP} -dSt $^ >$@
47
 
48
${NAME}.size: ${NAME}.elf
49
        ${OBJSIZE}  $^ >$@
50
 
51
download-uart: all
52
        openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 115200 ${NAME}.elf
53
 
54
clean:
55
        rm -f ${NAME} ${NAME}.a43 ${NAME}.lst ${NAME}.elf $(NAME).size *.o
56
 
57
#backup archive
58
dist:
59
        tar czf dist.tgz *.c *.h *.txt makefile
60
 
61
#dummy target as dependecy if something has to be build everytime
62
FORCE:
63
 
64
#project dependencies
65
main.o: main.c
66
../../libs/tA/timerA.o: ../../libs/tA/timerA.c

powered by: WebSVN 2.1.0

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