makefile: Ensure imagefiles are available in build image context

This commit is contained in:
Jean-Christophe Fillion-Robin 2016-11-25 15:51:38 -05:00
parent 593d6a5c07
commit 191d773e01
No known key found for this signature in database
GPG Key ID: 15C1A2812F958BD3
3 changed files with 15 additions and 5 deletions

4
.gitignore vendored
View File

@ -2,5 +2,5 @@ bin
dockcross
*/test/
Dockerfile
*/install-openssl.sh
!imagefiles/install-openssl.sh
*/imagefiles/*
!imagefiles/*

View File

@ -39,7 +39,9 @@ test: base.test $(addsuffix .test,$(IMAGES))
#
# browser-asmjs
#
browser-asmjs: base
browser-asmjs: base browser-asmjs/Dockerfile.in common.docker
sed '/common.docker/ r common.docker' $@/Dockerfile.in > $@/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
cp -r test browser-asmjs/
$(DOCKER) build -t $(ORG)/browser-asmjs \
--build-arg IMAGE=$(ORG)/browser-asmjs \
@ -48,10 +50,13 @@ browser-asmjs: base
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
browser-asmjs
rm -rf browser-asmjs/test
rm -rf $@/imagefiles
browser-asmjs.test: browser-asmjs
cp -r test browser-asmjs/
$(DOCKER) run --rm dockcross/browser-asmjs > $(BIN)/dockcross-browser-asmjs && chmod +x $(BIN)/dockcross-browser-asmjs
$(BIN)/dockcross-browser-asmjs python test/run.py --exe-suffix ".js"
rm -rf browser-asmjs/test
#
# manylinux-x64
@ -60,12 +65,14 @@ manylinux-x64/Dockerfile: manylinux-x64/Dockerfile.in common.docker common.manyl
sed -e '/common.docker/ r common.docker' -e '/common.manylinux/ r common.manylinux' manylinux-x64/Dockerfile.in > manylinux-x64/Dockerfile
manylinux-x64: manylinux-x64/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(DOCKER) build -t $(ORG)/manylinux-x64 \
--build-arg IMAGE=$(ORG)/manylinux-x64 \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux-x64/Dockerfile .
rm -rf $@/imagefiles
manylinux-x64.test: manylinux-x64
$(DOCKER) run --rm dockcross/manylinux-x64 > $(BIN)/dockcross-manylinux-x64 && chmod +x $(BIN)/dockcross-manylinux-x64
@ -78,12 +85,14 @@ manylinux-x86/Dockerfile: manylinux-x86/Dockerfile.in common.docker common.manyl
sed -e '/common.docker/ r common.docker' -e '/common.manylinux/ r common.manylinux' manylinux-x86/Dockerfile.in > manylinux-x86/Dockerfile
manylinux-x86: manylinux-x86/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(DOCKER) build -t $(ORG)/manylinux-x86 \
--build-arg IMAGE=$(ORG)/manylinux-x86 \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux-x86/Dockerfile .
rm -rf $@/imagefiles
manylinux-x86.test: manylinux-x86
$(DOCKER) run --rm dockcross/manylinux-x86 > $(BIN)/dockcross-manylinux-x86 && chmod +x $(BIN)/dockcross-manylinux-x86
@ -116,13 +125,14 @@ $(VERBOSE).SILENT: display_images
# build implicit rule
#
$(STANDARD_IMAGES): base
cp imagefiles/install-openssl.sh $@/
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(DOCKER) build -t $(ORG)/$@ \
--build-arg IMAGE=$(ORG)/$@ \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
$@
rm -rf $@/imagefiles
#
# testing implicit rule

View File

@ -34,7 +34,7 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \
CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++
COPY install-openssl.sh /dockcross/
COPY imagefiles/install-openssl.sh /dockcross/
RUN \
/dockcross/install-openssl.sh -32 && \
rm /dockcross/install-openssl.sh