]> rtime.felk.cvut.cz Git - fpga/virtex2/plasma.git/commitdiff
Added software Makefile. master
authorVladimir Burian <buriavl2@fel.cvut.cz>
Tue, 15 Feb 2011 20:00:56 +0000 (21:00 +0100)
committerVladimir Burian <buriavl2@fel.cvut.cz>
Tue, 15 Feb 2011 20:00:56 +0000 (21:00 +0100)
Design is now complete and test applications can be executed.

build/Makefile
software/Makefile [new file with mode: 0644]

index de4d9dc405618b9478784bb206224e1ecd1cbdb8..c61ce8cab3d891d7e0966e88bb09466d491a6291 100644 (file)
@@ -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 (file)
index 0000000..ba560d5
--- /dev/null
@@ -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 $@ $<
+