aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2017-07-28 16:46:35 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-08-01 13:58:01 +1000
commitbd692075e6ed6deb85bc33ca54bac4493681b907 (patch)
tree8bfbf8bbee9176db7113a0bb346beb7e04bb03c6 /external
parentae6cb86c277e6a9b1d11548d8fa1b430116dba08 (diff)
downloadskiboot-bd692075e6ed6deb85bc33ca54bac4493681b907.zip
skiboot-bd692075e6ed6deb85bc33ca54bac4493681b907.tar.gz
skiboot-bd692075e6ed6deb85bc33ca54bac4493681b907.tar.bz2
external: Consolidate Makefile.check for external tools
The reason for this is that check targets for one tool will start to depend on other tools. For example, future pflash tests will rely on ffspart to generate pnors. The current method is too racey and results in races cleaning/building ffspart for its tests and for pflash tests. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/Makefile.check31
-rw-r--r--external/ffspart/test/Makefile.check20
-rw-r--r--external/gard/test/Makefile.check26
3 files changed, 31 insertions, 46 deletions
diff --git a/external/Makefile.check b/external/Makefile.check
new file mode 100644
index 0000000..9147421
--- /dev/null
+++ b/external/Makefile.check
@@ -0,0 +1,31 @@
+# -*-Makefile-*-
+
+TOOL=gard ffspart
+CHECK_TOOL=$(patsubst %,check-%,$(TOOL))
+TOOL_COVERAGE=$(patsubst %,%-coverage,$(TOOL))
+TOOL_TEST_CLEAN=$(patsubst %,%-test-clean,$(TOOL))
+
+
+.PHONY: check
+check: $(CHECK_TOOL)
+
+#Makefile knows to build and clean it before checking, should also
+#make clean before checking. If not, .o files for different
+#architectures might be lying around and clean once done to avoid the
+#opposite
+.PHONY: $(CHECK_TOOL)
+$(CHECK_TOOL):
+ $(call QTEST, RUN-TEST , make CC=$(HOSTCC) CROSS='' CROSS_COMPILE='' \
+ -C external/$(patsubst check-%,%,$@) check, $@)
+
+clean: $(TOOL_TEST_CLEAN)
+
+.PHONY: $(TOOL_COVERAGE)
+coverage: $(TOOL_COVERAGE)
+
+$(TOOL_COVERAGE): $(patsubst %-coverage, check-%, $@)
+
+.PHONY: $(TOOL_TEST_CLEAN)
+$(TOOL_TEST_CLEAN):
+ $(call QTEST, CLEANUP , make -C external/$(patsubst %-test-clean,%,$@) clean, $@)
+
diff --git a/external/ffspart/test/Makefile.check b/external/ffspart/test/Makefile.check
deleted file mode 100644
index b1a1a3c..0000000
--- a/external/ffspart/test/Makefile.check
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*-Makefile-*-
-
-check: check-ffspart
-
-#Makefile knows to build it before checking, should also
-#make clean before checking. If not, .o files for different
-#architectures might be lying around and clean once done to
-#avoid the opposite
-check-ffspart: ffspart-test-clean
- @make CROSS_COMPILE='' -C external/ffspart/ check
- @make CROSS_COMPILE='' -C external/ffspart/ clean
-
-.PHONY: check-ffspart
-
-clean: ffspart-test-clean
-
-ffspart-test-clean:
- @make -C external/ffspart clean
-
-.PHONY: ffspart-test-clean
diff --git a/external/gard/test/Makefile.check b/external/gard/test/Makefile.check
deleted file mode 100644
index 593d053..0000000
--- a/external/gard/test/Makefile.check
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*-Makefile-*-
-
-check: check-gard
-
-#Makefile knows to build it before checking, should also
-#make clean before checking. If not, .o files for different
-#architectures might be lying around and clean once done to
-#avoid the opposite
-check-gard: gard-test-clean gard
- $(call QTEST, RUN-TEST , make CC=$(HOSTCC) CROSS='' CROSS_COMPILE='' -C external/gard/ check, $@)
- $(call QTEST, CLEANUP , make CC=$(HOSTCC) CROSS='' CROSS_COMPILE='' -C external/gard/ clean, $@)
-
-.PHONY: check-gard
-
-clean: gard-test-clean
-
-.PHONY: gard-coverage
-
-coverage: gard-coverage
-
-gard-coverage: check-gard
-
-gard-test-clean:
- $(call QTEST, CLEANUP , make -C external/gard clean, $@)
-
-.PHONY: gard-test-clean