2018-02-02 00:20:26 +03:00
|
|
|
SRCDIR = ../single_include
|
2016-07-18 17:22:10 +03:00
|
|
|
SED:=$(shell command -v gsed || which sed)
|
2015-06-21 22:24:03 +03:00
|
|
|
|
2015-07-08 17:55:29 +03:00
|
|
|
all: doxygen
|
|
|
|
|
2015-06-21 22:24:03 +03:00
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# example files
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
# where are the example cpp files
|
|
|
|
EXAMPLES = $(wildcard examples/*.cpp)
|
|
|
|
|
|
|
|
# create output from a stand-alone example file
|
|
|
|
%.output: %.cpp
|
|
|
|
make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
|
|
|
|
./$(<:.cpp=) > $@
|
|
|
|
rm $(<:.cpp=)
|
|
|
|
|
|
|
|
# compare created output with current output of the example files
|
|
|
|
%.test: %.cpp
|
|
|
|
make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
|
|
|
|
./$(<:.cpp=) > $@
|
|
|
|
diff $@ $(<:.cpp=.output)
|
|
|
|
rm $(<:.cpp=) $@
|
|
|
|
|
2015-06-30 00:02:41 +03:00
|
|
|
# create links to try the code online
|
|
|
|
%.link: %.cpp
|
|
|
|
rm -fr tmp
|
|
|
|
mkdir tmp
|
2018-02-02 00:20:26 +03:00
|
|
|
cp -r $(SRCDIR)/nlohmann tmp
|
2018-02-11 16:46:15 +03:00
|
|
|
python2 scripts/send_to_wandbox.py tmp $< > $@.tmp
|
2015-06-30 00:02:41 +03:00
|
|
|
/bin/echo -n "<a target=\"_blank\" href=\"`cat $@.tmp`\"><b>online</b></a>" > $@
|
|
|
|
rm -fr tmp $@.tmp
|
|
|
|
|
2015-06-21 22:24:03 +03:00
|
|
|
# create output from all stand-alone example files
|
|
|
|
create_output: $(EXAMPLES:.cpp=.output)
|
|
|
|
|
2015-06-30 00:02:41 +03:00
|
|
|
create_links: $(EXAMPLES:.cpp=.link)
|
|
|
|
|
2015-06-21 22:24:03 +03:00
|
|
|
# check output of all stand-alone example files
|
|
|
|
check_output: $(EXAMPLES:.cpp=.test)
|
|
|
|
|
|
|
|
|
2016-05-29 15:06:43 +03:00
|
|
|
clean:
|
2021-09-01 09:43:10 +03:00
|
|
|
rm -fr me.nlohmann.json.docset html $(EXAMPLES:.cpp=)
|
2020-08-13 11:52:20 +03:00
|
|
|
$(MAKE) clean -C docset
|
|
|
|
$(MAKE) clean -C mkdocs
|
2016-05-29 15:06:43 +03:00
|
|
|
|
|
|
|
|
2015-06-21 22:24:03 +03:00
|
|
|
##########################################################################
|
|
|
|
# Doxygen HTML documentation
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
# create Doxygen documentation
|
2015-06-30 01:12:18 +03:00
|
|
|
doxygen: create_output create_links
|
2015-06-21 22:24:03 +03:00
|
|
|
doxygen
|
2017-02-21 21:11:34 +03:00
|
|
|
$(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html
|
|
|
|
$(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType JSONSerializer >@@g' html/*.html
|
|
|
|
$(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html
|
|
|
|
$(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html
|
|
|
|
$(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType JSONSerializer >@@g' html/*.html
|
2017-03-01 23:28:44 +03:00
|
|
|
$(SED) -i 's@template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer>@@g' html/*.html
|
2017-03-09 01:12:13 +03:00
|
|
|
$(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html
|
|
|
|
$(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html
|
2019-07-02 22:15:52 +03:00
|
|
|
$(SED) -i 's@JSON_HEDLEY_RETURNS_NON_NULL@@g' html/*.html
|
|
|
|
$(SED) -i 's@JSON_HEDLEY_WARN_UNUSED_RESULT@@g' html/*.html
|
2015-06-21 22:24:03 +03:00
|
|
|
|
2015-07-14 22:21:08 +03:00
|
|
|
upload: clean doxygen check_output
|
2017-12-17 12:20:30 +03:00
|
|
|
scripts/git-update-ghpages nlohmann/json html
|
2015-06-21 22:51:23 +03:00
|
|
|
rm -fr html
|
|
|
|
open http://nlohmann.github.io/json/
|