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"

```
This commit is contained in:
Jean-Christophe Fillion-Robin 2016-09-25 23:28:23 -04:00
parent 4caa5a367f
commit 8a4e0845da
No known key found for this signature in database
GPG Key ID: 15C1A2812F958BD3
2 changed files with 12 additions and 19 deletions

View File

@ -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

View File

@ -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