1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- DEBIAN_RELEASE := stretch
- XILINX_TARBALL := Xilinx_ISE_DS_Lin_14.7_1015_1.tar
- XILINX_LICENSE := Xilinx.lic
- XILINX_PKGDIR := fs/$(basename ${XILINX_TARBALL})
- BOOT_CONTAINER := cryptech-builder-boot
- BOOT_IMAGE := cryptech-builder:boot
- BASE_IMAGE := cryptech-builder:base
- BASE_IMAGE_EXISTS := $(shell docker image ls -q ${BASE_IMAGE})
- BOOT_IMAGE_EXISTS := $(shell docker image ls -q ${BOOT_IMAGE})
- BOOT_CONTAINER_EXISTS := $(shell docker container ls -a --format='{{.Names}}' --filter='name=^/${BOOT_CONTAINER}$$')
- ifneq (./,$(sort $(dir ${XILINX_TARBALL} ${XILINX_LICENSE})))
- $(error XILINX_TARBALL and XILINX_LICENSE must be in this directory for bind mount)
- endif
- all:
- ifeq (,${BASE_IMAGE_EXISTS})
- docker container rm -f ${BOOT_CONTAINER} || true
- ifeq (,${BOOT_IMAGE_EXISTS})
- rm -rf fs
- mkdir fs
- sudo /usr/sbin/debootstrap --foreign ${DEBIAN_RELEASE} 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
- mogrify -verbose -format png *.xwd && rm -f *.xwd || true
- 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} || true
- sandblast: clean
- docker image rm -f ${BOOT_IMAGE} || true
- docker image rm -f ${BASE_IMAGE} || true
- .PHONY: all clean sandblast
|