12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- XILINX_TARBALL := Xilinx_ISE_DS_Lin_14.7_1015_1.tar
- XILINX_LICENSE := Xilinx.lic
- XILINX_PKGDIR := fs/$(basename ${XILINX_TARBALL})
- BOOT_IMAGE := cryptech-builder:boot
- BOOT_CONTAINER := cryptech-builder-boot
- BASE_IMAGE := cryptech-builder:base
- ifneq (./,$(sort $(dir ${XILINX_TARBALL} ${XILINX_LICENSE})))
- $(error XILINX_TARBALL and XILINX_LICENSE must be in this directory for bind mount)
- endif
- all:
- ifeq (,$(shell docker image ls -q ${BASE_IMAGE}))
- -docker container rm -f ${BOOT_CONTAINER}
- ifeq (,$(shell docker image ls -q ${BOOT_IMAGE}))
- rm -rf fs
- mkdir fs
- sudo /usr/sbin/deboot --foreign jessie fs
- sudo tar -C fs -c . | docker import - ${BOOT_IMAGE}
- endif
- sudo rm -rf fs
- mkdir fs
- tar -C fs -xf ${XILINX_TARBALL}
- test -d ${XILINX_PKGDIR}
- docker run -it --name ${BOOT_CONTAINER} \
- --mount type=bind,source=$(abspath .),target=/cryptech-builder \
- --env 'XILINX_PKGDIR=/cryptech-builder/${XILINX_PKGDIR}' \
- --env 'XILINX_LICENSE=${XILINX_LICENSE}' \
- ${BOOT_IMAGE} \
- /cryptech-builder/Builder
- rm -rf fs
- ifneq (,$(wildcard /usr/bin/mogrify))
- -mogrify -verbose -format png *.xwd && rm -f *.xwd
- endif
- docker commit ${BOOT_CONTAINER} ${BASE_IMAGE}
- docker container rm -f ${BOOT_CONTAINER}
- endif
- docker build -t cryptech-builder .
- clean:
- git clean -dfx -e ${XILINX_TARBALL} -e ${XILINX_LICENSE}
- -docker container rm -f ${BOOT_CONTAINER}
- sandblast: clean
- -docker image rm -f ${BOOT_IMAGE}
- -docker image rm -f ${BASE_IMAGE}
- .PHONY: all clean sandblast
|