Makefile 1.4 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. BOOTSTRAP_IMAGE := cryptech-builder:bootstrap
  5. BOOTSTRAP_CONTAINER := cryptech-builder-bootstrap
  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: $(if $(shell docker image ls -q ${NAME}:${VERS}),,Dockerfile ${DEB})
  11. all:
  12. ifeq (,$(shell docker image ls -q ${BASE_IMAGE}))
  13. -docker container rm -f ${BOOTSTRAP_CONTAINER}
  14. -docker image rm -f ${BOOTSTRAP_IMAGE}
  15. rm -rf fs
  16. mkdir fs
  17. sudo /usr/sbin/debootstrap --foreign jessie fs
  18. sudo tar -C fs -c . | docker import - ${BOOTSTRAP_IMAGE}
  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 ${BOOTSTRAP_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. ${BOOTSTRAP_IMAGE} \
  28. /cryptech-builder/Builder
  29. rm -rf fs
  30. -mogrify -verbose -format png *.xwd && rm *.xwd
  31. docker ${BOOTSTRAP_CONTAINER} ${BASE_IMAGE}
  32. docker container rm -f ${BOOTSTRAP_CONTAINER}
  33. endif
  34. docker build -t cryptech-builder .
  35. clean:
  36. git clean -dfx -e ${XILINX_TARBALL} -e ${XILINX_LICENSE}
  37. -docker container rm -f ${BOOTSTRAP_CONTAINER}
  38. .PHONY: all clean