From c34ed497ff35804048461445c85172217ba5ffd0 Mon Sep 17 00:00:00 2001 From: Jeff Donahue Date: Thu, 28 Aug 2014 01:44:02 -0700 Subject: [PATCH] add "make {docs,doxygen}" targets to build doxygen-generated docs --- Makefile | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dd9ba5c8376..50e68acd84c 100644 --- a/Makefile +++ b/Makefile @@ -187,6 +187,25 @@ ALL_BUILD_DIRS := $(sort \ $(PROTO_BUILD_DIR) $(PROTO_BUILD_INCLUDE_DIR) $(PY_PROTO_BUILD_DIR) \ $(DISTRIBUTE_SUBDIRS)) +############################## +# Set directory for Doxygen-generated documentation +############################## +DOXYGEN_CONFIG_FILE ?= ./.Doxyfile +DOXYGEN_OUTPUT_DIR ?= ./doxygen # should be the same as OUTPUT_DIRECTORY in the .Doxyfile +DOXYGEN_COMMAND ?= doxygen +# All the files that might have Doxygen documentation. +DOXYGEN_SOURCES := $(shell find \ + src/$(PROJECT) \ + include/$(PROJECT) \ + python/ \ + matlab/ \ + examples \ + tools \ + -name "*.cpp" -or -name "*.hpp" -or -name "*.cu" -or -name "*.cuh" -or \ + -name "*.py" -or -name "*.m") +DOXYGEN_SOURCES += $(DOXYGEN_CONFIG_FILE) + + ############################## # Configure build ############################## @@ -301,7 +320,7 @@ SUPERCLEAN_EXTS := .so .a .o .bin .testbin .pb.cc .pb.h _pb2.py .cuo ############################## # Define build targets ############################## -.PHONY: all test clean linecount lint lintclean tools examples $(DIST_ALIASES) \ +.PHONY: all test clean docs linecount lint lintclean tools examples $(DIST_ALIASES) \ py mat py$(PROJECT) mat$(PROJECT) proto runtest \ superclean supercleanlist supercleanfiles warn everything @@ -317,6 +336,11 @@ lint: $(EMPTY_LINT_REPORT) lintclean: @ $(RM) -r $(LINT_OUTPUT_DIR) $(EMPTY_LINT_REPORT) $(NONEMPTY_LINT_REPORT) +docs: $(DOXYGEN_OUTPUT_DIR) + +$(DOXYGEN_OUTPUT_DIR): $(DOXYGEN_CONFIG_FILE) $(DOXYGEN_SOURCES) + $(DOXYGEN_COMMAND) $(DOXYGEN_CONFIG_FILE) + $(EMPTY_LINT_REPORT): $(LINT_OUTPUTS) | $(BUILD_DIR) @ cat $(LINT_OUTPUTS) > $@ @ if [ -s "$@" ]; then \