2018-02-02 00:20:26 +03:00
|
|
|
SRCDIR = ../single_include
|
2015-07-08 17:55:29 +03:00
|
|
|
|
2021-12-29 15:41:01 +03:00
|
|
|
all: create_output
|
2015-06-21 22:24:03 +03:00
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# example files
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
# where are the example cpp files
|
|
|
|
EXAMPLES = $(wildcard examples/*.cpp)
|
|
|
|
|
2022-07-31 15:05:58 +03:00
|
|
|
cxx_standard = $(lastword c++11 $(filter c++%, $(subst ., ,$1)))
|
|
|
|
|
2015-06-21 22:24:03 +03:00
|
|
|
# create output from a stand-alone example file
|
|
|
|
%.output: %.cpp
|
2022-07-31 15:05:58 +03:00
|
|
|
@echo "standard $(call cxx_standard $(<:.cpp=))"
|
2022-07-31 18:38:52 +03:00
|
|
|
$(MAKE) $(<:.cpp=) \
|
|
|
|
CPPFLAGS="-I $(SRCDIR) -DJSON_USE_GLOBAL_UDLS=0" \
|
|
|
|
CXXFLAGS="-std=$(call cxx_standard,$(<:.cpp=)) -Wno-deprecated-declarations"
|
2015-06-21 22:24:03 +03:00
|
|
|
./$(<:.cpp=) > $@
|
|
|
|
rm $(<:.cpp=)
|
|
|
|
|
|
|
|
# compare created output with current output of the example files
|
|
|
|
%.test: %.cpp
|
2022-07-31 18:38:52 +03:00
|
|
|
$(MAKE) $(<:.cpp=) \
|
|
|
|
CPPFLAGS="-I $(SRCDIR) -DJSON_USE_GLOBAL_UDLS=0" \
|
|
|
|
CXXFLAGS="-std=$(call cxx_standard,$(<:.cpp=)) -Wno-deprecated-declarations"
|
2015-06-21 22:24:03 +03:00
|
|
|
./$(<:.cpp=) > $@
|
|
|
|
diff $@ $(<:.cpp=.output)
|
|
|
|
rm $(<:.cpp=) $@
|
|
|
|
|
|
|
|
# create output from all stand-alone example files
|
|
|
|
create_output: $(EXAMPLES:.cpp=.output)
|
|
|
|
|
|
|
|
# check output of all stand-alone example files
|
|
|
|
check_output: $(EXAMPLES:.cpp=.test)
|
|
|
|
|
2022-07-29 15:28:37 +03:00
|
|
|
# check output of all stand-alone example files (exclude files with platform-dependent output.)
|
|
|
|
# This target is used in the CI (ci_test_documentation).
|
|
|
|
check_output_portable: $(filter-out examples/meta.test examples/max_size.test examples/std_hash.test examples/basic_json__CompatibleType.test,$(EXAMPLES:.cpp=.test))
|
|
|
|
|
2016-05-29 15:06:43 +03:00
|
|
|
clean:
|
2021-12-29 15:41:01 +03:00
|
|
|
rm -fr $(EXAMPLES:.cpp=)
|
2020-08-13 11:52:20 +03:00
|
|
|
$(MAKE) clean -C docset
|
|
|
|
$(MAKE) clean -C mkdocs
|