You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
3.2 KiB

  1. SRCDIR = ../src
  2. all: doxygen
  3. clean:
  4. rm -fr me.nlohmann.json.docset html
  5. ##########################################################################
  6. # example files
  7. ##########################################################################
  8. # where are the example cpp files
  9. EXAMPLES = $(wildcard examples/*.cpp)
  10. # create output from a stand-alone example file
  11. %.output: %.cpp
  12. make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
  13. ./$(<:.cpp=) > $@
  14. rm $(<:.cpp=)
  15. # compare created output with current output of the example files
  16. %.test: %.cpp
  17. make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
  18. ./$(<:.cpp=) > $@
  19. diff $@ $(<:.cpp=.output)
  20. rm $(<:.cpp=) $@
  21. # create links to try the code online
  22. %.link: %.cpp
  23. rm -fr tmp
  24. mkdir tmp
  25. cp $(SRCDIR)/json.hpp tmp
  26. scripts/send_to_wandbox.py tmp $< > $@.tmp
  27. /bin/echo -n "<a target=\"_blank\" href=\"`cat $@.tmp`\"><b>online</b></a>" > $@
  28. rm -fr tmp $@.tmp
  29. # create output from all stand-alone example files
  30. create_output: $(EXAMPLES:.cpp=.output)
  31. create_links: $(EXAMPLES:.cpp=.link)
  32. # check output of all stand-alone example files
  33. check_output: $(EXAMPLES:.cpp=.test)
  34. ##########################################################################
  35. # Doxygen HTML documentation
  36. ##########################################################################
  37. # create Doxygen documentation
  38. doxygen: create_output create_links
  39. doxygen
  40. gsed -i 's@&lt; ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType &gt;@@g' html/*.html
  41. gsed -i 's@&lt;&#160;ObjectType,&#160;ArrayType,&#160;StringType,&#160;BooleanType,&#160;NumberIntegerType,&#160;NumberFloatType,&#160;AllocatorType&#160;&gt;@@g' html/*.html
  42. gsed -i 's@&lt; ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType &gt;@@g' html/*.html
  43. gsed -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType >@@g' html/*.html
  44. upload: clean doxygen check_output
  45. cd html ; ../scripts/git-update-ghpages nlohmann/json
  46. rm -fr html
  47. open http://nlohmann.github.io/json/
  48. ##########################################################################
  49. # docset
  50. ##########################################################################
  51. # create docset for Dash
  52. docset: create_output
  53. cp Doxyfile Doxyfile_docset
  54. gsed -i 's/DISABLE_INDEX = NO/DISABLE_INDEX = YES/' Doxyfile_docset
  55. gsed -i 's/SEARCHENGINE = YES/SEARCHENGINE = NO/' Doxyfile_docset
  56. gsed -i 's@HTML_EXTRA_STYLESHEET = css/mylayout.css@HTML_EXTRA_STYLESHEET = css/mylayout_docset.css@' Doxyfile_docset
  57. rm -fr html *.docset
  58. doxygen Doxyfile_docset
  59. gsed -i 's@&lt; ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType &gt;@@g' html/*.html
  60. gsed -i 's@&lt;&#160;ObjectType,&#160;ArrayType,&#160;StringType,&#160;BooleanType,&#160;NumberIntegerType,&#160;NumberFloatType,&#160;AllocatorType&#160;&gt;@@g' html/*.html
  61. make -C html
  62. mv html/*.docset .
  63. gsed -i 's@<string>doxygen</string>@<string>json</string>@' me.nlohmann.json.docset/Contents/Info.plist
  64. rm -fr Doxyfile_docset html