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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [actel_m1a3pl_dev_kit/] [software/] [spacewar/] [makefile] - Rev 214

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

# makfile configuration
NAME            = spacewar
OBJECTS         = bzsin.o  cline.o  compar.o  explode.o  hardware.o  main.o  point.o  reset.o  rocket1.o  rocket2.o  score.o  update.o

# Compiler performance option (-Os / -O2 / -O3)
PORT_CFLAGS     = -O2

# Choose GCC toolchain prefix ('msp430' for MSPGCC / 'msp430-elf' for GCC RedHat/TI)
ifndef MSPGCC_PFX
MSPGCC_PFX      = msp430-elf
endif

# disable some warnings specific to the Dhrystone code
WARNINGS        =  -Wall

# Select flags depending on selected toolchain
ifeq ($(MSPGCC_PFX),msp430-elf)
INCDIR          = -I /cad/ti/gcc/include
CFLAGS          = -D PFX_MSP430_ELF $(INCDIR) $(PORT_CFLAGS) ${WARNINGS} -g -mcpu=msp430 -mhwmult=none
else
CFLAGS          = -D PFX_MSP430               $(PORT_CFLAGS) ${WARNINGS} -g -mcpu=430    -mmpy=none     -mivcnt=16
endif

# Toolchain executables
CC              = ${MSPGCC_PFX}-gcc
OBJCOPY         = ${MSPGCC_PFX}-objcopy
OBJDUMP         = ${MSPGCC_PFX}-objdump
OBJSIZE         = ${MSPGCC_PFX}-size

.PHONY: all FORCE clean download dist

#all should be the first target. it's built when make is runwithout args
all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${NAME}.size

#serial download
download: download-uart

#additional rules for files
${NAME}.elf: ${OBJECTS}
        ${CC} ${CFLAGS} -T linker.${MSPGCC_PFX}.x -o $@ ${OBJECTS}

${NAME}.a43: ${NAME}.elf
        ${OBJCOPY} -O ihex $^ $@

${NAME}.lst: ${NAME}.elf
        ${OBJDUMP} -dSt $^ >$@

${NAME}.size: ${NAME}.elf
        ${OBJSIZE}  $^ >$@

download-uart: all
        openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 115200 ${NAME}.elf

clean:
        rm -f ${NAME} ${NAME}.a43 ${NAME}.lst ${NAME}.elf ${NAME}.size *.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
bzsin.o:    bzsin.c
cline.o:    cline.c    spacewar.h
compar.o:   compar.c   spacewar.h
explode.o:  explode.c
hardware.o: hardware.c spacewar.h
main.o:     main.c     spacewar.h
point.o:    point.c    spacewar.h
reset.o:    reset.c    spacewar.h
rocket1.o:  rocket1.c  spacewar.h
rocket2.o:  rocket2.c  spacewar.h
score.o:    score.c    spacewar.h
update.o:   update.c   spacewar.h

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

powered by: WebSVN 2.1.0

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