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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src-c/] [sandbox/] [makefile] - Blame information for rev 202

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

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

powered by: WebSVN 2.1.0

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