Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. -docker image rm -f ${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. sudo rm -rf fs
  19. mkdir fs
  20. tar -C fs -xf ${XILINX_TARBALL}
  21. test -d ${XILINX_PKGDIR}
  22. docker run -it --name ${BOOT_CONTAINER} \
  23. --mount type=bind,source=$(abspath .),target=/cryptech-builder \
  24. --env 'XILINX_PKGDIR=/cryptech-builder/${XILINX_PKGDIR}' \
  25. --env 'XILINX_LICENSE=${XILINX_LICENSE}' \
  26. ${BOOT_IMAGE} \
  27. /cryptech-builder/Builder
  28. rm -rf fs
  29. ifneq (,$(wildcard /usr/bin/mogrify))
  30. -mogrify -verbose -format png *.xwd && rm -f *.xwd
  31. endif
  32. docker commit ${BOOT_CONTAINER} ${BASE_IMAGE}
  33. docker container rm -f ${BOOT_CONTAINER}
  34. endif
  35. docker build -t cryptech-builder .
  36. clean:
  37. git clean -dfx -e ${XILINX_TARBALL} -e ${XILINX_LICENSE}
  38. -docker container rm -f ${BOOT_CONTAINER}
  39. .PHONY: all clean