Makefile: Add implicit rule for STANDARD_TESTS

To confirm that the Makefiles works as expected after this patch, the
list of executed commands before and after is 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 ../dockcross-$target-current ../dockcross-$target-baseline > /dev/null 2>&1
  [[ $? == 1 ]] && \
    echo "" && \
    echo "Error: Problem with '${target}' target: Dry-run output before and after this commit do not match."
done
```
This commit is contained in:
Jean-Christophe Fillion-Robin 2016-09-25 18:03:28 -04:00
parent 53b158314a
commit f7f6989e46
No known key found for this signature in database
GPG Key ID: 15C1A2812F958BD3

View File

@ -6,6 +6,8 @@ STANDARD_IMAGES = android-arm linux-x86 linux-x64 linux-arm64 linux-armv5 linux-
IMAGES = $(STANDARD_IMAGES) manylinux-x64 manylinux-x86
STANDARD_TESTS = android-arm linux-x86 linux-x64 linux-arm64 linux-armv5 linux-armv6 linux-armv7
images: base $(IMAGES)
test: base.test $(addsuffix .test,$(IMAGES))
@ -13,9 +15,10 @@ test: base.test $(addsuffix .test,$(IMAGES))
$(STANDARD_IMAGES): base
$(DOCKER) build -t $(ORG)/$@ $@
android-arm.test: android-arm
$(DOCKER) run --rm dockcross/android-arm > $(BIN)/dockcross-android-arm && chmod +x $(BIN)/dockcross-android-arm
$(BIN)/dockcross-android-arm python test/run.py
.SECONDEXPANSION:
$(addsuffix .test,$(STANDARD_TESTS)): $$(basename $$@)
$(DOCKER) run --rm dockcross/$(basename $@) > $(BIN)/dockcross-$(basename $@) && chmod +x $(BIN)/dockcross-$(basename $@)
$(BIN)/dockcross-$(basename $@) python test/run.py
browser-asmjs: base
cp -r test browser-asmjs/
@ -26,30 +29,6 @@ browser-asmjs.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"
linux-x86.test: linux-x86
$(DOCKER) run --rm dockcross/linux-x86 > $(BIN)/dockcross-linux-x86 && chmod +x $(BIN)/dockcross-linux-x86
$(BIN)/dockcross-linux-x86 python test/run.py
linux-x64.test: linux-x64
$(DOCKER) run --rm dockcross/linux-x64 > $(BIN)/dockcross-linux-x64 && chmod +x $(BIN)/dockcross-linux-x64
$(BIN)/dockcross-linux-x64 python test/run.py
linux-arm64.test: linux-arm64
$(DOCKER) run --rm dockcross/linux-arm64 > $(BIN)/dockcross-linux-arm64 && chmod +x $(BIN)/dockcross-linux-arm64
$(BIN)/dockcross-linux-arm64 python test/run.py
linux-armv5.test: linux-armv5
$(DOCKER) run --rm dockcross/linux-armv5 > $(BIN)/dockcross-linux-armv5 && chmod +x $(BIN)/dockcross-linux-armv5
$(BIN)/dockcross-linux-armv5 python test/run.py
linux-armv6.test: linux-armv6
$(DOCKER) run --rm dockcross/linux-armv6 > $(BIN)/dockcross-linux-armv6 && chmod +x $(BIN)/dockcross-linux-armv6
$(BIN)/dockcross-linux-armv6 python test/run.py
linux-armv7.test: linux-armv7
$(DOCKER) run --rm dockcross/linux-armv7 > $(BIN)/dockcross-linux-armv7 && chmod +x $(BIN)/dockcross-linux-armv7
$(BIN)/dockcross-linux-armv7 python test/run.py
linux-ppc64le: base
$(DOCKER) build -t $(ORG)/linux-ppc64le linux-ppc64le