.PHONY: cmake
cmake:
- @cd bundled/cmake && make
+ cd bundled/cmake && make
@echo
@echo =======================================================
@echo
builddir:= $(testdir)/build
installdir:= $(testdir)/install
-.PHONY: build-test
+.PHONY: build_test
build-test:
- @mkdir -p $(builddir)
- @mkdir -p $(installdir)
- @cd $(builddir) && "$(CMAKE)" -C "$(CONFIGFILE)" -DCMAKE_INSTALL_PREFIX=$(installdir) $(PWD) >$(testdir)/configure.log 2>&1
- @cp $(builddir)/summary.log $(testdir)
- @cd $(builddir) && make log >/dev/null 2>&1
- @cp $(builddir)/cmake.log $(testdir)
- @cd $(builddir) && make $(MAKEOPTS) install >$(testdir)/build.log 2>&1
-
+ mkdir -p $(builddir)
+ mkdir -p $(installdir)
+ cd $(builddir) && "$(CMAKE)" -C "$(CONFIGFILE)" -DCMAKE_INSTALL_PREFIX=$(installdir) $(PWD) >$(testdir)/configure.log 2>&1
+ cp $(builddir)/summary.log $(testdir)
+ cd $(builddir) && make log >/dev/null 2>&1
+ cp $(builddir)/cmake.log $(testdir)
+ cd $(builddir) && make $(MAKEOPTS) install >$(testdir)/build.log 2>&1
+ cd $(installdir)/examples && make run_examples >$(testdir)/examples.log 2>&1
default:
endif
-steps:= $(wildcard step-*)
-configure_examples:
- @echo "============ Configure all examples"
- @for f in $(steps);\
- do\
- cd $(PWD)/$$f ;\
- cmake .;\
- cd $(PWD);\
- done
+steps:= $(wildcard step-*)
.PHONY: configure_examples
+configure_examples: $(steps:%=%/Makefile)
+
+%/Makefile:
+ -cd $(@D) && cmake . > /dev/null 2>&1
+
+.PHONY: run_examples
+run_examples: $(steps:%=%/Output)
+%/Output: %/Makefile
+ cd $(@D) && if [ -f Makefile ]; then make run; fi > Output 2>&1