# makfile configuration
|
# makfile configuration
|
NAME = dhrystone_v2.1
|
NAME = dhrystone_v2.1
|
OBJECTS = dhry_1.o dhry_2.o omsp_func.o copydata.o
|
OBJECTS = dhry_1.o dhry_2.o omsp_func.o mylib/copydata.o mylib/cprintf.o
|
|
|
# Compiler performance option (-Os / -O2 / -O3)
|
# Compiler performance option (-Os / -O2 / -O3)
|
PORT_CFLAGS = -O2
|
PORT_CFLAGS = -O2
|
|
|
# Choose GCC toolchain prefix ('msp430' for MSPGCC / 'msp430-elf' for GCC RedHat/TI)
|
# Choose GCC toolchain prefix ('msp430' for MSPGCC / 'msp430-elf' for GCC RedHat/TI)
|
|
MSPGCC_PFX = msp430-elf
|
ifndef MSPGCC_PFX
|
ifndef MSPGCC_PFX
|
MSPGCC_PFX = msp430
|
MSPGCC_PFX = msp430
|
endif
|
endif
|
|
|
# disable some warnings specific to the Dhrystone code
|
# disable some warnings specific to the Dhrystone code
|
WARNINGS = -Wall -Wno-implicit-int -Wno-implicit-function-declaration -Wno-return-type
|
WARNINGS = -Wall -Wno-implicit-int -Wno-implicit-function-declaration -Wno-return-type
|
|
|
# Select flags depending on selected toolchain
|
# Select flags depending on selected toolchain
|
ifeq ($(MSPGCC_PFX),msp430-elf)
|
ifeq ($(MSPGCC_PFX),msp430-elf)
|
CFLAGS = -D PFX_MSP430_ELF $(PORT_CFLAGS) ${WARNINGS} -g -mcpu=msp430 -mhwmult=16bit
|
CFLAGS = -D PFX_MSP430_ELF $(PORT_CFLAGS) ${WARNINGS} -g -mcpu=msp430 -mhwmult=16bit
|
else
|
else
|
CFLAGS = -D PFX_MSP430 $(PORT_CFLAGS) ${WARNINGS} -g -mcpu=430 -mmpy=16 -mivcnt=16
|
CFLAGS = -D PFX_MSP430 $(PORT_CFLAGS) ${WARNINGS} -g -mcpu=430 -mmpy=16 -mivcnt=16
|
endif
|
endif
|
|
|
# Toolchain executables
|
# Toolchain executables
|
CC = ${MSPGCC_PFX}-gcc
|
CC = ${MSPGCC_PFX}-gcc
|
OBJCOPY = ${MSPGCC_PFX}-objcopy
|
OBJCOPY = ${MSPGCC_PFX}-objcopy
|
OBJDUMP = ${MSPGCC_PFX}-objdump
|
OBJDUMP = ${MSPGCC_PFX}-objdump
|
|
OBJSIZE = ${MSPGCC_PFX}-size
|
|
|
.PHONY: all FORCE clean download dist
|
.PHONY: all FORCE clean download dist
|
|
|
#all should be the first target. it's built when make is runwithout args
|
#all should be the first target. it's built when make is runwithout args
|
all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst
|
all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${NAME}.size
|
|
|
#configure the next line if you want to use the serial download
|
#configure the next line if you want to use the serial download
|
download: download-uart
|
download: download-uart
|
|
|
#additional rules for files
|
#additional rules for files
|
${NAME}.elf: ${OBJECTS}
|
${NAME}.elf: ${OBJECTS}
|
${CC} ${CFLAGS} -T linker.${MSPGCC_PFX}.x -o $@ ${OBJECTS}
|
${CC} ${CFLAGS} -T linker.${MSPGCC_PFX}.x -o $@ ${OBJECTS}
|
|
|
${NAME}.a43: ${NAME}.elf
|
${NAME}.a43: ${NAME}.elf
|
${OBJCOPY} -O ihex $^ $@
|
${OBJCOPY} -O ihex $^ $@
|
|
|
${NAME}.lst: ${NAME}.elf
|
${NAME}.lst: ${NAME}.elf
|
${OBJDUMP} -dSt $^ >$@
|
${OBJDUMP} -dSt $^ >$@
|
|
|
|
${NAME}.size: ${NAME}.elf
|
|
${OBJSIZE} $^ >$@
|
|
|
download-uart: all
|
download-uart: all
|
openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 115200 ${NAME}.elf
|
openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 115200 ${NAME}.elf
|
|
|
clean:
|
clean:
|
rm -f ${NAME} ${NAME}.a43 ${NAME}.lst ${NAME}.elf *.o
|
rm -f ${NAME} ${NAME}.a43 ${NAME}.lst ${NAME}.elf ${NAME}.size *.o mylib/*.o
|
|
|
#backup archive
|
#backup archive
|
dist:
|
dist:
|
tar czf dist.tgz *.c *.h *.txt makefile
|
tar czf dist.tgz *.c *.h *.txt makefile
|
|
|
#dummy target as dependecy if something has to be build everytime
|
#dummy target as dependecy if something has to be build everytime
|
FORCE:
|
FORCE:
|
|
|
#project dependencies
|
#project dependencies
|
dhry_1.o: dhry_1.c
|
dhry_1.o: dhry_1.c
|
dhry_2.o: dhry_2.c
|
dhry_2.o: dhry_2.c
|
omsp_func.o: omsp_func.c
|
omsp_func.o: omsp_func.c
|
copydata.o: copydata.c
|
mylib/copydata.o: mylib/copydata.c
|
|
mylib/cprintf.o: mylib/cprintf.c
|
|
|