Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. XILINX_TARBALL := Xilinx_ISE_DS_Lin_14.7_1015_1.tar
  2. XILINX_LICENSE := Xilinx.lic
  3. XILINX_PKGDIR := fs/$(basename ${XILINX_TARBALL})
  4. BOOT_IMAGE := cryptech-builder:boot
  5. BOOT_CONTAINER := cryptech-builder-boot
  6. BASE_IMAGE := cryptech-builder:base
  7. ifneq (./,$(sort $(dir ${XILINX_TARBALL} ${XILINX_LICENSE})))
  8. $(error XILINX_TARBALL and XILINX_LICENSE must be in this directory for bind mount)
  9. endif
  10. all:
  11. ifeq (,$(shell docker image ls -q ${BASE_IMAGE}))
  12. -docker container rm -f ${BOOT_CONTAINER}
  13. ifeq (,$(shell docker image ls -q ${BOOT_IMAGE}))
  14. rm -rf fs
  15. mkdir fs
  16. sudo /usr/sbin/deboot --foreign jessie fs
  17. sudo tar -C fs -c . | docker import - ${BOOT_IMAGE}
  18. endif
  19. sudo rm -rf fs
  20. mkdir fs
  21. tar -C fs -xf ${XILINX_TARBALL}
  22. test -d ${XILINX_PKGDIR}
  23. docker run -it --name ${BOOT_CONTAINER} \
  24. --mount type=bind,source=$(abspath .),target=/cryptech-builder \
  25. --env 'XILINX_PKGDIR=/cryptech-builder/${XILINX_PKGDIR}' \
  26. --env 'XILINX_LICENSE=${XILINX_LICENSE}' \
  27. ${BOOT_IMAGE} \
  28. /cryptech-builder/Builder
  29. rm -rf fs
  30. ifneq (,$(wildcard /usr/bin/mogrify))
  31. -mogrify -verbose -format png *.xwd && rm -f *.xwd
  32. endif
  33. docker commit ${BOOT_CONTAINER} ${BASE_IMAGE}
  34. docker container rm -f ${BOOT_CONTAINER}
  35. endif
  36. docker build -t cryptech-builder .
  37. clean:
  38. git clean -dfx -e ${XILINX_TARBALL} -e ${XILINX_LICENSE}
  39. -docker container rm -f ${BOOT_CONTAINER}
  40. sandblast: clean
  41. -docker image rm -f ${BOOT_IMAGE}
  42. -docker image rm -f ${BASE_IMAGE}
  43. .PHONY: all clean sandblast