From 8a4e0845da4b34f533612220148f8098565986a5 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sun, 25 Sep 2016 23:28:23 -0400 Subject: [PATCH] Makefile: All images are tested. Remove ALL_IMAGES and DEFAULT_IMAGES vars. To confirm that the Makefiles works as expected after this patch, the list of executed commands before and after has been compared. Before: ``` make --dry-run > ../dockcross-make-baseline make test --dry-run > ../dockcross-make-test-baseline ``` After: ``` make --dry-run > ../dockcross-make-current; make test --dry-run > ../dockcross-make-test-current for target in make make-test; do diff --ignore-trailing-space ../dockcross-$target-baseline ../dockcross-$target-current> /dev/null 2>&1 [[ $? == 1 ]] && \ echo "" && \ echo "-------------------------------" && \ echo "Here is output of:" && \ echo " diff --ignore-trailing-space ../dockcross-$target-baseline ../dockcross-$target-current" && \ echo "" && \ diff --ignore-trailing-space ../dockcross-$target-baseline ../dockcross-$target-current done ``` Output: ``` ------------------------------- Here is output of: diff --ignore-trailing-space ../dockcross-make-baseline ../dockcross-make-current 8a9 > docker build -t dockcross/linux-ppc64le linux-ppc64le 10a12,14 > cp -r test browser-asmjs/ > docker build -t dockcross/browser-asmjs browser-asmjs > rm -rf browser-asmjs/test ------------------------------- Here is output of: diff --ignore-trailing-space ../dockcross-make-test-baseline ../dockcross-make-test-current 24a25,27 > docker build -t dockcross/linux-ppc64le linux-ppc64le > docker run --rm dockcross/linux-ppc64le > bin/dockcross-linux-ppc64le && chmod +x bin/dockcross-linux-ppc64le > bin/dockcross-linux-ppc64le python test/run.py --languages C 30a34,38 > cp -r test browser-asmjs/ > docker build -t dockcross/browser-asmjs browser-asmjs > rm -rf browser-asmjs/test > 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" ``` --- Makefile | 22 ++++++++-------------- README.rst | 9 ++++----- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 19d0c9d..9d4894e 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,7 @@ STANDARD_IMAGES = android-arm linux-x86 linux-x64 linux-arm64 linux-armv5 linux- NON_STANDARD_IMAGES = browser-asmjs manylinux-x64 manylinux-x86 # This list all available images -ALL_IMAGES = $(STANDARD_IMAGES) $(NON_STANDARD_IMAGES) - -# Set DEFAULT_IMAGES by excluding experimental images from ALL_IMAGES -DEFAULT_IMAGES = $(filter-out browser-asmjs linux-ppc64le, $(ALL_IMAGES)) +IMAGES = $(STANDARD_IMAGES) $(NON_STANDARD_IMAGES) # Optional arguments for test runner (test/run.py) associated with "testing implicit rule" linux-ppc64le.test_ARGS = --languages C @@ -30,14 +27,14 @@ windows-x86.test_ARGS = --exe-suffix ".exe" windows-x64.test_ARGS = --exe-suffix ".exe" # -# images: This target builds all DEFAULT_IMAGES (because it is the first one, it is built by default) +# images: This target builds all IMAGES (because it is the first one, it is built by default) # -images: base $(DEFAULT_IMAGES) +images: base $(IMAGES) # # test: This target ensures all IMAGES are built and run the associated tests # -test: base.test $(addsuffix .test,$(DEFAULT_IMAGES)) +test: base.test $(addsuffix .test,$(IMAGES)) # # browser-asmjs @@ -93,13 +90,10 @@ base.test: base # # display # -display_default_images: - for image in $(DEFAULT_IMAGES); do echo $$image; done +display_images: + for image in $(IMAGES); do echo $$image; done -display_all_images: - for image in $(ALL_IMAGES); do echo $$image; done - -$(VERBOSE).SILENT: display_default_images display_all_images +$(VERBOSE).SILENT: display_images # # build implicit rule @@ -115,4 +109,4 @@ $(addsuffix .test,$(STANDARD_IMAGES)): $$(basename $$@) $(DOCKER) run --rm dockcross/$(basename $@) > $(BIN)/dockcross-$(basename $@) && chmod +x $(BIN)/dockcross-$(basename $@) $(BIN)/dockcross-$(basename $@) python test/run.py $($@_ARGS) -.PHONY: base images $(ALL_IMAGES) test %.test +.PHONY: base images $(IMAGES) test %.test diff --git a/README.rst b/README.rst index fe30d58..b8b3957 100644 --- a/README.rst +++ b/README.rst @@ -183,11 +183,10 @@ source cross-compiler Docker image or the dockcross script itself. Download all images ------------------- -To easily download all images, the convenience target ``display_all_images`` or ``display_default_images`` -could be used:: +To easily download all images, the convenience target ``display_images`` could be used:: curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile - for image in $(make -f dockcross-Makefile display_all_images); do + for image in $(make -f dockcross-Makefile display_images); do echo "Pulling dockcross/$image" docker pull dockcross/$image done @@ -196,10 +195,10 @@ Install all dockcross scripts ----------------------------- To automatically install in ``~/bin`` the dockcross scripts for each images already downloaded, the -convenience target ``display_all_images`` or ``display_default_images`` could be used:: +convenience target ``display_images`` could be used:: curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile - for image in $(make -f dockcross-Makefile display_all_images); do + for image in $(make -f dockcross-Makefile display_images); do if [[ $(docker images -q dockcross/$image) == "" ]]; then echo "~/bin/dockcross-$image skipping: image not found locally" continue