| 1 |
SRCDIR = ../single_include |
| 2 |
|
| 3 |
all: create_output |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
EXAMPLES = $(wildcard mkdocs/docs/examples/*.cpp) |
| 11 |
|
| 12 |
cxx_standard = $(lastword c++11 $(filter c++%, $(subst ., ,$1))) |
| 13 |
|
| 14 |
|
| 15 |
%.output: %.cpp |
| 16 |
@echo "standard $(call cxx_standard $(<:.cpp=))" |
| 17 |
$(MAKE) $(<:.cpp=) \ |
| 18 |
CPPFLAGS="-I $(SRCDIR) -DJSON_USE_GLOBAL_UDLS=0" \ |
| 19 |
CXXFLAGS="-std=$(call cxx_standard,$(<:.cpp=)) -Wno-deprecated-declarations" |
| 20 |
./$(<:.cpp=) > $@ |
| 21 |
rm $(<:.cpp=) |
| 22 |
|
| 23 |
|
| 24 |
%.test: %.cpp |
| 25 |
$(MAKE) $(<:.cpp=) \ |
| 26 |
CPPFLAGS="-I $(SRCDIR) -DJSON_USE_GLOBAL_UDLS=0" \ |
| 27 |
CXXFLAGS="-std=$(call cxx_standard,$(<:.cpp=)) -Wno-deprecated-declarations" |
| 28 |
./$(<:.cpp=) > $@ |
| 29 |
diff $@ $(<:.cpp=.output) |
| 30 |
rm $(<:.cpp=) $@ |
| 31 |
|
| 32 |
|
| 33 |
create_output: $(EXAMPLES:.cpp=.output) |
| 34 |
|
| 35 |
|
| 36 |
check_output: $(EXAMPLES:.cpp=.test) |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
check_output_portable: $(filter-out mkdocs/docs/examples/meta.test mkdocs/docs/examples/max_size.test mkdocs/docs/examples/std_hash.test mkdocs/docs/examples/basic_json__CompatibleType.test,$(EXAMPLES:.cpp=.test)) |
| 41 |
|
| 42 |
clean: |
| 43 |
rm -fr $(EXAMPLES:.cpp=) |
| 44 |
$(MAKE) clean -C docset |