From 65564d653f5f45092155daee9576d301a3b85fb5 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Thu, 12 Jul 2018 13:04:29 +0200 Subject: [PATCH] Generate doxygen doc in doc/doxygen with make --- Makefile | 7 ++++++- src/Makefile | 7 ++++++- tools/Doxyfile | 8 ++++---- tools/Makefile | 18 +++++++++++++++++- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b1b1add5..0d2bbd62 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,12 @@ OPT = WIN32CROSS=1 \ endif -.PHONY: all tools grafx2 ziprelease 3rdparty win32installer +.PHONY: all tools grafx2 ziprelease 3rdparty win32installer doc doxygen all: grafx2 tools +doc: doxygen + grafx2: $(OPT)$(MAKE) -C src/ @@ -21,3 +23,6 @@ tools: win32installer: $(MAKE) -C install/ + +doxygen: + $(MAKE) -C tools/ doxygen diff --git a/src/Makefile b/src/Makefile index a83b39f7..8027bf10 100644 --- a/src/Makefile +++ b/src/Makefile @@ -642,7 +642,7 @@ endif ### And now for the real build rules ### -.PHONY : all debug release clean depend force install uninstall valgrind +.PHONY : all debug release clean depend force install uninstall valgrind doc doxygen # This is the list of the objects we want to build. Dependancies are built by "make depend" automatically. OBJS = main.o init.o graph.o $(APIOBJ) misc.o special.o \ @@ -967,4 +967,9 @@ endif valgrind: $(BIN) valgrind --suppressions=../valgrind.grafx2.suppr --leak-check=full --show-leak-kinds=all --num-callers=20 $(BIN) +doc: doxygen + +doxygen: + $(MAKE) -C ../tools doxygen + -include Makefile.dep diff --git a/tools/Doxyfile b/tools/Doxyfile index 4bca0fcc..e0b39c66 100644 --- a/tools/Doxyfile +++ b/tools/Doxyfile @@ -44,7 +44,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = "The ultimate 256-color painting program" # With the PROJECT_LOGO tag one can specify an logo or icon that is included in # the documentation. The maximum height of the logo should not exceed 55 pixels @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = out +OUTPUT_DIRECTORY = ../doc/doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -753,7 +753,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = +INPUT = ../src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -804,7 +804,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = SDLMain.* \ +EXCLUDE_PATTERNS = recoil.* \ *.py # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names diff --git a/tools/Makefile b/tools/Makefile index e024c483..4c1918dd 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,4 +1,11 @@ -.PHONY: all gifanalyzer sdl_image_test test_iff +DOXYGEN = doxygen +GIT_REVISION = $(shell cat ../src/version.c | cut -f 2 -d '"') +LABEL = $(shell cat ../src/pversion.c | cut -f 2 -d '"') +VERSION = $(subst wip.,wip,$(LABEL).$(GIT_REVISION)) + +SOURCES = $(wildcard ../src/*.c) $(wildcard ../src/*.h) + +.PHONY: all gifanalyzer sdl_image_test test_iff doxygen all: gifanalyzer sdl_image_test test_iff @@ -10,3 +17,12 @@ sdl_image_test: test_iff: $(MAKE) -C $@ + +doxygen: ../doc/doxygen/html/index.html + +../doc/doxygen/html/index.html: Doxyfile $(SOURCES) + $(DOXYGEN) + +Doxyfile: ../src/version.c ../src/pversion.c + sed -e 's/^\(PROJECT_NUMBER[ ]*=[ ]*\).*$$/\1 "$(VERSION)"/' $@ > $@.tmp + mv $@.tmp $@