From b182e16ec3a1479315eac099b33cc188f65838ae Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Thu, 9 Jul 2015 15:57:08 -0500 Subject: [PATCH] Local testing on VC2010 and VC2012. Also improved the documentation Makefile not to re-generate the samples unless the source Markdown files are newer. This should make samples development easier. --- doc/Makefile | 20 +++++++++++--------- test/Makefile | 17 ++++++----------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 701e693..ad7ec9b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,5 +1,7 @@ -SOURCE_MARKDOWN := $(wildcard tutorial/*) $(wildcard demo/*) -SOURCE_CXX := $(SOURCE_MARKDOWN:.md=.cc) +toexample = ../example/$(notdir $(1:.md=.cc)) + +SOURCE_MARKDOWN := $(wildcard tutorial/*.md) $(wildcard demo/*.md) +SOURCE_CXX := $(foreach md,$(SOURCE_MARKDOWN),$(call toexample,$(md))) .PHONY : html html : @@ -20,15 +22,15 @@ web : examples python docs.py --web .PHONY : examples -examples : clean-examples $(SOURCE_CXX) +examples : $(SOURCE_CXX) -.PHONY : clean-examples -clean-examples : - make -C ../example clean - rm -f ../example/*.cc +define EXAMPLE +$(1) : $(2) + python transform.py --o-cxx $(1) $(2) +endef -%.cc : %.md - python transform.py --o-cxx ../example/$(notdir $@) $< +$(foreach md,$(SOURCE_MARKDOWN), \ + $(eval $(call EXAMPLE,$(call toexample,$(md)),$(md)))) .PHONY : clean clean : diff --git a/test/Makefile b/test/Makefile index 05980b8..278a367 100644 --- a/test/Makefile +++ b/test/Makefile @@ -49,21 +49,14 @@ DEFAULTS := \ # regular C++11 or C++98 build (no constexpr to_string and no strict # conversions). .PHONY : default -default : +default : examples make $(DEFAULTS) one-configuration # Builds all configurations with the system compiler. .PHONY : default-all -default-all : +default-all : examples make $(DEFAULTS) all-configurations -# Re-generates the examples from the Markdown, and then builds all -# configurations with the system compiler. Should be done before a pull request, -# but not practical for regular use because it touches dependencies and causes -# full rebuilds. -.PHONY : default-thorough -default-thorough : examples default-all - .PHONY : examples examples : make -C ../doc examples @@ -137,7 +130,7 @@ all-configurations : one-configuration .PHONY : all-unix -all-unix : +all-unix : examples make COMPILER=clang++36 unix make COMPILER=g++51 unix make COMPILER=g++46 unix @@ -152,9 +145,11 @@ all-unix : make COMPILER=clang++35 unix .PHONY : all-ms -all-ms : +all-ms : examples make TITLE=vc2015 COMPILER="Visual Studio 14 2015" ms make TITLE=vc2008 COMPILER="Visual Studio 9 2008" ms + make TITLE=vc2010 COMPILER="Visual Studio 10 2010" ms + make TITLE=vc2012 COMPILER="Visual Studio 11 2012" ms make TITLE=vc2013 COMPILER="Visual Studio 12 2013" ms $(CXXTEST_GENERATED) : cxxtest/*.h