1SRCDIR = ../single_include 2SED:=$(shell command -v gsed || which sed) 3 4all: doxygen 5 6 7########################################################################## 8# example files 9########################################################################## 10 11# where are the example cpp files 12EXAMPLES = $(wildcard examples/*.cpp) 13 14# create output from a stand-alone example file 15%.output: %.cpp 16 make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11" 17 ./$(<:.cpp=) > $@ 18 rm $(<:.cpp=) 19 20# compare created output with current output of the example files 21%.test: %.cpp 22 make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11" 23 ./$(<:.cpp=) > $@ 24 diff $@ $(<:.cpp=.output) 25 rm $(<:.cpp=) $@ 26 27# create links to try the code online 28%.link: %.cpp 29 rm -fr tmp 30 mkdir tmp 31 cp -r $(SRCDIR)/nlohmann tmp 32 python2 scripts/send_to_wandbox.py tmp $< > $@.tmp 33 /bin/echo -n "<a target=\"_blank\" href=\"`cat $@.tmp`\"><b>online</b></a>" > $@ 34 rm -fr tmp $@.tmp 35 36# create output from all stand-alone example files 37create_output: $(EXAMPLES:.cpp=.output) 38 39create_links: $(EXAMPLES:.cpp=.link) 40 41# check output of all stand-alone example files 42check_output: $(EXAMPLES:.cpp=.test) 43 44 45clean: 46 rm -fr me.nlohmann.json.docset html xml $(EXAMPLES:.cpp=) 47 48 49########################################################################## 50# Doxygen HTML documentation 51########################################################################## 52 53# create Doxygen documentation 54doxygen: create_output create_links 55 doxygen 56 $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html 57 $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType JSONSerializer >@@g' html/*.html 58 $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html 59 $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html 60 $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType JSONSerializer >@@g' html/*.html 61 $(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 62 $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html 63 $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >@@g' html/*.html 64 $(SED) -i 's@JSON_HEDLEY_RETURNS_NON_NULL@@g' html/*.html 65 $(SED) -i 's@JSON_HEDLEY_WARN_UNUSED_RESULT@@g' html/*.html 66 67upload: clean doxygen check_output 68 scripts/git-update-ghpages nlohmann/json html 69 rm -fr html 70 open http://nlohmann.github.io/json/ 71 72 73########################################################################## 74# docset 75########################################################################## 76 77# create docset for Dash 78docset: create_output 79 cp Doxyfile Doxyfile_docset 80 $(SED) -i 's/DISABLE_INDEX = NO/DISABLE_INDEX = YES/' Doxyfile_docset 81 $(SED) -i 's/SEARCHENGINE = YES/SEARCHENGINE = NO/' Doxyfile_docset 82 $(SED) -i 's@HTML_EXTRA_STYLESHEET = css/mylayout.css@HTML_EXTRA_STYLESHEET = css/mylayout_docset.css@' Doxyfile_docset 83 rm -fr html *.docset 84 doxygen Doxyfile_docset 85 $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType >@@g' html/*.html 86 $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType >@@g' html/*.html 87 make -C html 88 mv html/*.docset . 89 $(SED) -i 's@<string>doxygen</string>@<string>json</string>@' me.nlohmann.json.docset/Contents/Info.plist 90 rm -fr Doxyfile_docset html 91