summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile127
1 files changed, 69 insertions, 58 deletions
diff --git a/Makefile b/Makefile
index 980969e..afe7547 100644
--- a/Makefile
+++ b/Makefile
@@ -4,11 +4,12 @@ SRCS=$(wildcard *.vhd *.v *.qsf *.qpf )
SRCS += $(shell find DM9000A -type f -print )
SRCS += $(shell find GPU -type f -print )
-#CSRC=${SRC:src/%=%}
-#CSDIRS=${SDIRS:src/%=%}
+BSP_DIR=bsp
-#ELFDIR=../software/pong3
-BSPDIR=../software/pong3_bsp
+SOPC_FILE=my_sys.sopcinfo
+BSP_TYPE=hal
+NIOS2_BSP_ARGS=""
+CPU_NAME=
sta.stamp:asm.stamp
@@ -27,62 +28,72 @@ ans.stamp: source.stamp
tools/wrap quartus_map --read_settings_files=on --write_settings_files=off ${PROJ} -c ${PROJ}
touch $@
+${SOPC_FILE}:ans.stamp
+
source.stamp:${SRC}
touch source.stamp
-
-ELF=pong3.elf
-
-SOPCINFO=../my_sys.sopcinfo
-SOF=../pong3.sof
-
-run: load_elf.stamp
- ./wrap.sh nios2-terminal
-
-flash: load_sof.stamp sof.flash elf.flash ${BSPDIR}/system.h
- BASE=` grep EPCS_FLASH_CONTROLLER_0_BASE ${BSPDIR}/system.h | awk '{print $$3}' ` && \
- ./wrap.sh nios2-flash-programmer sof.flash --base=$${BASE} --epcs --accept-bad-sysid --device=1 --instance=0 --program --verbose && \
- ./wrap.sh nios2-flash-programmer elf.flash --base=$${BASE} --epcs --accept-bad-sysid --device=1 --instance=0 --program --verbose -g
-
-sof.flash: ${SOF}
- ./wrap.sh sof2flash --input=$< --output=$@ --epcs --verbose
-
-elf.flash: ${ELFDIR}/${ELF} sof.flash
- ./wrap.sh elf2flash --input=${ELFDIR}/${ELF} --output=$@ --epcs --after=sof.flash --verbose
-
-
-
-
+bsp.stamp:${SOPC_FILE}
+ /bin/rm -rf ${BSP_DIR}
+ mkdir -p ${BSP_DIR}
+ tools/wrap nios2-bsp ${BSP_TYPE} ${BSP_DIR} ${SOPC_FILE} ${NIOS2_BSP_ARGS} ${CPU_NAME}
+ tools/wrap make -C ${BSP_DIR}
+ touch $@
-
-load_elf.stamp:${ELFDIR}/${ELF} load_sof.stamp
- ./wrap.sh nios2-download ${ELFDIR}/${ELF} -g
-
-load_sof.stamp: ${SOF}
- ./wrap.sh quartus_pgm -m JTAG -o 'p;../pong3.sof'
-
-${ELFDIR}/${ELF}: ${BSPDIR}/libhal_bsp.a $(wildcard ${ELFDIR}/*.[chHC])
- ./wrap.sh ${MAKE} -C ${ELFDIR}
-
-
-${BSPDIR}/libhal_bsp.a:${BSPDIR}/system.h
- ./wrap.sh ${MAKE} -C ${BSPDIR}
-
-${BSPDIR}/system.h:${SOPCINFO}
- rm -f $@
- (cd ${BSPDIR} && ${PWD}/wrap.sh ./create-this-bsp )
-
-
-clean:
- ./wrap.sh ${MAKE} -C ${BSPDIR} clean
- ./wrap.sh ${MAKE} -C ${ELFDIR} clean
- /bin/rm -f sof.flash elf.flash
- /bin/rm -rf ${BSPDIR}/drivers ${BSPDIR}/HAL ${BSPDIR}/linker.h ${BSPDIR}/linker.x ${BSPDIR}/system.h ${BSPDIR}/summary.html ${BSPDIR}/public.mk ${BSPDIR}/mem_init.mk ${BSPDIR}/memory.gdb ${BSPDIR}/alt_sys_init.c
-
-
-
-
-
-
-
+#
+#ELF=pong3.elf
+#
+#SOPCINFO=../my_sys.sopcinfo
+#SOF=../pong3.sof
+#
+#run: load_elf.stamp
+# ./wrap.sh nios2-terminal
+#
+#flash: load_sof.stamp sof.flash elf.flash ${BSPDIR}/system.h
+# BASE=` grep EPCS_FLASH_CONTROLLER_0_BASE ${BSPDIR}/system.h | awk '{print $$3}' ` && \
+# ./wrap.sh nios2-flash-programmer sof.flash --base=$${BASE} --epcs --accept-bad-sysid --device=1 --instance=0 --program --verbose && \
+# ./wrap.sh nios2-flash-programmer elf.flash --base=$${BASE} --epcs --accept-bad-sysid --device=1 --instance=0 --program --verbose -g
+#
+#sof.flash: ${SOF}
+# ./wrap.sh sof2flash --input=$< --output=$@ --epcs --verbose
+#
+#elf.flash: ${ELFDIR}/${ELF} sof.flash
+# ./wrap.sh elf2flash --input=${ELFDIR}/${ELF} --output=$@ --epcs --after=sof.flash --verbose
+#
+#
+#
+#
+#
+#
+#
+#load_elf.stamp:${ELFDIR}/${ELF} load_sof.stamp
+# ./wrap.sh nios2-download ${ELFDIR}/${ELF} -g
+#
+#load_sof.stamp: ${SOF}
+# ./wrap.sh quartus_pgm -m JTAG -o 'p;../pong3.sof'
+#
+#${ELFDIR}/${ELF}: ${BSPDIR}/libhal_bsp.a $(wildcard ${ELFDIR}/*.[chHC])
+# ./wrap.sh ${MAKE} -C ${ELFDIR}
+#
+#
+#${BSPDIR}/libhal_bsp.a:${BSPDIR}/system.h
+# ./wrap.sh ${MAKE} -C ${BSPDIR}
+#
+#${BSPDIR}/system.h:${SOPCINFO}
+# rm -f $@
+# (cd ${BSPDIR} && ${PWD}/wrap.sh ./create-this-bsp )
+#
+#
+#clean:
+# ./wrap.sh ${MAKE} -C ${BSPDIR} clean
+# ./wrap.sh ${MAKE} -C ${ELFDIR} clean
+# /bin/rm -f sof.flash elf.flash
+# /bin/rm -rf ${BSPDIR}/drivers ${BSPDIR}/HAL ${BSPDIR}/linker.h ${BSPDIR}/linker.x ${BSPDIR}/system.h ${BSPDIR}/summary.html ${BSPDIR}/public.mk ${BSPDIR}/mem_init.mk ${BSPDIR}/memory.gdb ${BSPDIR}/alt_sys_init.c
+#
+#
+#
+#
+#
+#
+#