1
0
mirror of https://github.com/nlohmann/json synced 2024-11-30 15:40:07 +00:00
nlohmannjson/doc/Makefile

84 lines
3.2 KiB
Makefile
Raw Normal View History

2015-06-21 19:24:03 +00:00
SRCDIR = ../src
all: doxygen
2015-06-21 19:24:03 +00: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-29 21:02:41 +00:00
# create links to try the code online
%.link: %.cpp
rm -fr tmp
mkdir tmp
cp $(SRCDIR)/json.hpp tmp
2015-07-26 08:59:17 +00:00
scripts/send_to_wandbox.py tmp $< > $@.tmp
2015-06-29 21:02:41 +00:00
/bin/echo -n "<a target=\"_blank\" href=\"`cat $@.tmp`\"><b>online</b></a>" > $@
rm -fr tmp $@.tmp
2015-06-21 19:24:03 +00:00
# create output from all stand-alone example files
create_output: $(EXAMPLES:.cpp=.output)
2015-06-29 21:02:41 +00:00
create_links: $(EXAMPLES:.cpp=.link)
2015-06-21 19:24:03 +00:00
# check output of all stand-alone example files
check_output: $(EXAMPLES:.cpp=.test)
2016-05-29 12:06:43 +00:00
clean:
rm -fr me.nlohmann.json.docset html $(EXAMPLES:.cpp=)
2015-06-21 19:24:03 +00:00
##########################################################################
# Doxygen HTML documentation
##########################################################################
# create Doxygen documentation
2015-06-29 22:12:18 +00:00
doxygen: create_output create_links
2015-06-21 19:24:03 +00:00
doxygen
gsed -i 's@&lt; ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType &gt;@@g' html/*.html
gsed -i 's@&lt;&#160;ObjectType,&#160;ArrayType,&#160;StringType,&#160;BooleanType,&#160;NumberIntegerType,&#160;NumberFloatType,&#160;AllocatorType&#160;&gt;@@g' html/*.html
2016-01-31 12:05:39 +00:00
gsed -i 's@&lt; ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType &gt;@@g' html/*.html
2016-02-07 13:55:29 +00:00
gsed -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType >@@g' html/*.html
2015-06-21 19:24:03 +00:00
upload: clean doxygen check_output
2015-07-26 08:59:17 +00:00
cd html ; ../scripts/git-update-ghpages nlohmann/json
2015-06-21 19:51:23 +00:00
rm -fr html
open http://nlohmann.github.io/json/
2015-06-21 19:24:03 +00:00
##########################################################################
# docset
##########################################################################
# create docset for Dash
docset: create_output
cp Doxyfile Doxyfile_docset
gsed -i 's/DISABLE_INDEX = NO/DISABLE_INDEX = YES/' Doxyfile_docset
gsed -i 's/SEARCHENGINE = YES/SEARCHENGINE = NO/' Doxyfile_docset
gsed -i 's@HTML_EXTRA_STYLESHEET = css/mylayout.css@HTML_EXTRA_STYLESHEET = css/mylayout_docset.css@' Doxyfile_docset
rm -fr html *.docset
doxygen Doxyfile_docset
gsed -i 's@&lt; ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType &gt;@@g' html/*.html
gsed -i 's@&lt;&#160;ObjectType,&#160;ArrayType,&#160;StringType,&#160;BooleanType,&#160;NumberIntegerType,&#160;NumberFloatType,&#160;AllocatorType&#160;&gt;@@g' html/*.html
make -C html
mv html/*.docset .
gsed -i 's@<string>doxygen</string>@<string>json</string>@' me.nlohmann.json.docset/Contents/Info.plist
rm -fr Doxyfile_docset html