diff options
author | James <james.mckenzie@citrix.com> | 2013-10-12 11:54:45 +0100 |
---|---|---|
committer | James <james.mckenzie@citrix.com> | 2013-10-12 11:54:45 +0100 |
commit | 001378df36e77efdb74d007f140cef1bf9b3fe7e (patch) | |
tree | 078d562fe602382a0bffe7774b12e5796aa23b17 | |
parent | d5553117c38966e51b52b7fb26ee433db5d664c9 (diff) | |
download | pong-001378df36e77efdb74d007f140cef1bf9b3fe7e.tar.gz pong-001378df36e77efdb74d007f140cef1bf9b3fe7e.tar.bz2 pong-001378df36e77efdb74d007f140cef1bf9b3fe7e.zip |
fish
-rw-r--r-- | Makefile | 127 |
1 files changed, 69 insertions, 58 deletions
@@ -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 +# +# +# +# +# +# +# |