|
@@ -2,18 +2,22 @@ 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
|
|
|
+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 (,$(shell docker image ls -q ${BASE_IMAGE}))
|
|
|
- -docker container rm -f ${BOOT_CONTAINER}
|
|
|
-ifeq (,$(shell docker image ls -q ${BOOT_IMAGE}))
|
|
|
+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 jessie fs
|
|
@@ -30,9 +34,7 @@ endif
|
|
|
${BOOT_IMAGE} \
|
|
|
/cryptech-builder/Builder
|
|
|
rm -rf fs
|
|
|
-ifneq (,$(wildcard /usr/bin/mogrify))
|
|
|
- -mogrify -verbose -format png *.xwd && rm -f *.xwd
|
|
|
-endif
|
|
|
+ mogrify -verbose -format png *.xwd && rm -f *.xwd || true
|
|
|
docker commit ${BOOT_CONTAINER} ${BASE_IMAGE}
|
|
|
docker container rm -f ${BOOT_CONTAINER}
|
|
|
endif
|
|
@@ -40,10 +42,10 @@ endif
|
|
|
|
|
|
clean:
|
|
|
git clean -dfx -e ${XILINX_TARBALL} -e ${XILINX_LICENSE}
|
|
|
- -docker container rm -f ${BOOT_CONTAINER}
|
|
|
+ docker container rm -f ${BOOT_CONTAINER} || true
|
|
|
|
|
|
sandblast: clean
|
|
|
- -docker image rm -f ${BOOT_IMAGE}
|
|
|
- -docker image rm -f ${BASE_IMAGE}
|
|
|
+ docker image rm -f ${BOOT_IMAGE} || true
|
|
|
+ docker image rm -f ${BASE_IMAGE} || true
|
|
|
|
|
|
.PHONY: all clean sandblast
|