Debian Codegraph @

docs/Makefile

raw symbols SCIP
1 SRCDIR = ../single_include
2
3 all: create_output
4
5 ##########################################################################
6 # example files
7 ##########################################################################
8
9 # where are the example cpp files
10 EXAMPLES = $(wildcard mkdocs/docs/examples/*.cpp)
11
12 cxx_standard = $(lastword c++11 $(filter c++%, $(subst ., ,$1)))
13
14 # create output from a stand-alone example file
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 # compare created output with current output of the example files
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 # create output from all stand-alone example files
33 create_output: $(EXAMPLES:.cpp=.output)
34
35 # check output of all stand-alone example files
36 check_output: $(EXAMPLES:.cpp=.test)
37
38 # check output of all stand-alone example files (exclude files with platform-dependent output.)
39 # This target is used in the CI (ci_test_documentation).
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