From 0c9829260576e101407259772bfda2b83832cc35 Mon Sep 17 00:00:00 2001 From: Vladimir Burian Date: Tue, 15 Feb 2011 21:00:56 +0100 Subject: [PATCH] Added software Makefile. Design is now complete and test applications can be executed. --- build/Makefile | 2 +- software/Makefile | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 software/Makefile diff --git a/build/Makefile b/build/Makefile index de4d9dc..c61ce8c 100644 --- a/build/Makefile +++ b/build/Makefile @@ -45,7 +45,7 @@ PRJ = ${TOP}.prj UCF = ${TOP}.ucf BMM = ram_xilinx.bmm -ELF = +ELF = software/opcodes.elf SEARCH_DIRS = diff --git a/software/Makefile b/software/Makefile new file mode 100644 index 0000000..ba560d5 --- /dev/null +++ b/software/Makefile @@ -0,0 +1,75 @@ +# Annotation +#================================================== +# Script is capable of building different applications. +# Application target is an appropriate *.elf file name, +# (e.g. "opcodes.elf") which must be listed in +# ${ALL_ELF} variable and must have at least one rule +# with depending object files. +# +# See "Rules of different projects". +# +# WARNING !!! +# As the link process is not ideally implemented, when +# you are building an app then "boot.o" and "no_os.o" +# are usually dependencies. And "boot.o" MUST be listed +# as the first dependency! + +AS = mips-elf-as +CC = mips-elf-gcc +LD = mips-elf-ld +OD = mips-elf-objdump + +LDFLAGS = -eentry -Ttext=0 -N -s +CFLAGS = -I ${PLASMA_INCLUDE} + +PLASMA_INCLUDE = ../plasma/tools + +ALL_ELF = opcodes.elf test.elf + + + +.PHONY: help clean +help: + + +# Rules of different projects +#================================================== +opcodes.elf: opcodes.o + +test.elf: boot.o test.o no_os.o + + +# General rules: +#================================================== +${ALL_ELF}: + ${LD} ${LDFLAGS} -Map ${@:.elf=.map} -o $@ $^ + ${OD} -d -t -S $@ > ${@:.elf=.lst} + +%.o: %.c + ${CC} ${CFLAGS} -c -o $@ $< + +%.o: %.asm + ${AS} -o $@ $< + +%.o: %.a + ${AS} -o $@ $< + + +# Special .PHONY targets +#================================================== +clean: + rm -r *.o *.elf *.lst *.map + +help: + @echo Select one of the targets: + @echo ${ALL_ELF} + + +# Additional rules for "boot.o" and "no_os.o" +#================================================== +%.o: ${PLASMA_INCLUDE}/%.asm + ${AS} -o $@ $< + +%.o: ${PLASMA_INCLUDE}/%.c + ${CC} ${CFLAGS} -c -o $@ $< + -- 2.39.2