From 397801f79a4fcf1d601bbd19afaac27a396c828d Mon Sep 17 00:00:00 2001 From: Jon Daniel Date: Fri, 14 Feb 2025 22:05:44 +0100 Subject: [PATCH 1/4] Add GNUInstallDirs and BINDIR/DOCDIR updates --- .gitignore | 63 +++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 4 ++- bspinfo/CMakeLists.txt | 2 +- bsputil/CMakeLists.txt | 2 +- docs/CMakeLists.txt | 2 +- docs/Makefile | 20 ------------ light/CMakeLists.txt | 10 +++--- lightpreview/CMakeLists.txt | 2 +- maputil/CMakeLists.txt | 2 +- qbsp/CMakeLists.txt | 2 +- vis/CMakeLists.txt | 2 +- 11 files changed, 78 insertions(+), 33 deletions(-) delete mode 100644 docs/Makefile diff --git a/.gitignore b/.gitignore index 05be7cd59..51095fef1 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,66 @@ CMakeSettings.json sphinx-venv **/__pycache__ *-env +3rdparty/CMakeFiles +3rdparty/cmake_install.cmake +3rdparty/Makefile +docs/docs +light/CMakeFiles +light/cmake_install.cmake +light/Makefile +light/light +light/lib* +vis/CMakeFiles +vis/cmake_install.cmake +vis/Makefile +vis/vis +vis/lib* +qbsp/Makefile +qbsp/CMakeFiles +qbsp/cmake_install.cmake +qbsp/qbsp +qbsp/lib* +bspinfo/Makefile +bspinfo/CMakeFiles +bspinfo/cmake_install.cmake +bspinfo/bspinfo +bspinfo/lib* +bsputil/Makefile +bsputil/CMakeFiles +bsputil/cmake_install.cmake +bsputil/bsputil +bsputil/lib* +maputil/Makefile +maputil/CMakeFiles +maputil/cmake_install.cmake +maputil/maputil +maputil/lib* +common/lib* +lightpreview/Makefile +lightpreview/CMakeFiles +lightpreview/cmake_install.cmake +lightpreview/lightpreview +lightpreview/lightpreview_autogen +lightpreview/lib* +tests/Makefile +tests/CMakeFiles +tests/cmake_install.cmake +tests/tests +tests/lib* +testmaps.hh +cmake_install.cmake +Makefile +CMakeCache.txt +CPackConfig.cmake +CPackSourceConfig.cmake +CTestTestConfig.cmake +CTestTestfile.cmake +docs/CTestTestConfig.cmake +docs/CTestTestfile.cmake +docs/cmake_install.cmake +docs/Makefile +docs/CMakeFiles/ +docs/CMakeCache.txt +lib/lib* +install_manifest.txt +_deps/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 3493db772..e75213504 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_policy(SET CMP0028 NEW) project (ericw-tools) +include(GNUInstallDirs) + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/3rdparty/Catch2/extras") @@ -202,7 +204,7 @@ if(NOT DISABLE_DOCS) add_subdirectory(docs) endif () -install(FILES README.md DESTINATION .) +install(FILES README.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) #CPack configuration diff --git a/bspinfo/CMakeLists.txt b/bspinfo/CMakeLists.txt index c87320c9b..c4cf4c11b 100644 --- a/bspinfo/CMakeLists.txt +++ b/bspinfo/CMakeLists.txt @@ -9,4 +9,4 @@ add_custom_command(TARGET bspinfo POST_BUILD copy_mingw_dlls(bspinfo) add_loader_path_to_rpath(bspinfo) -install(TARGETS bspinfo RUNTIME DESTINATION .) +install(TARGETS bspinfo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/bsputil/CMakeLists.txt b/bsputil/CMakeLists.txt index b4be5acde..2765ace3d 100644 --- a/bsputil/CMakeLists.txt +++ b/bsputil/CMakeLists.txt @@ -17,4 +17,4 @@ add_custom_command(TARGET bsputil POST_BUILD copy_mingw_dlls(bsputil) add_loader_path_to_rpath(bsputil) -install(TARGETS bsputil RUNTIME DESTINATION .) +install(TARGETS bsputil RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index a2556a66d..6a806f9e8 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -14,5 +14,5 @@ if (Sphinx_FOUND) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating documentation with Sphinx") - install(DIRECTORY ${SPHINX_BUILD}/ DESTINATION doc) + install(DIRECTORY ${SPHINX_BUILD}/ DESTINATION ${CMAKE_INSTALL_DOCDIR}) endif() diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d4bb2cbb9..000000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/light/CMakeLists.txt b/light/CMakeLists.txt index 197127f43..a1758df08 100644 --- a/light/CMakeLists.txt +++ b/light/CMakeLists.txt @@ -1,5 +1,5 @@ -option(SKIP_TBB_INSTALL "Skip TBB Library Installation" OFF) -option(SKIP_EMBREE_INSTALL "Skip Embree Library Installation" OFF) +option(SKIP_TBB_INSTALL "Skip TBB Library Installation" ON) +option(SKIP_EMBREE_INSTALL "Skip Embree Library Installation" ON) set(LIGHT_INCLUDES ../include/light/entities.hh @@ -92,7 +92,7 @@ if (embree_FOUND) endif() if(NOT SKIP_EMBREE_INSTALL) - install(FILES $ DESTINATION .) + install(FILES $ DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() # install TBB @@ -140,5 +140,5 @@ endif(embree_FOUND) copy_mingw_dlls(light) add_loader_path_to_rpath(light) -install(TARGETS light RUNTIME DESTINATION .) -install(FILES ../gpl_v3.txt DESTINATION .) +install(TARGETS light RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES ../gpl_v3.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}) diff --git a/lightpreview/CMakeLists.txt b/lightpreview/CMakeLists.txt index 806c1e8c3..6cd31d33c 100644 --- a/lightpreview/CMakeLists.txt +++ b/lightpreview/CMakeLists.txt @@ -111,4 +111,4 @@ if (APPLE) apple_install_lib(Qt5::DBus "$/QtDBus.framework/Versions/5") endif () -install(TARGETS lightpreview RUNTIME DESTINATION . BUNDLE DESTINATION .) +install(TARGETS lightpreview RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/maputil/CMakeLists.txt b/maputil/CMakeLists.txt index e92af3505..8fd47bb06 100644 --- a/maputil/CMakeLists.txt +++ b/maputil/CMakeLists.txt @@ -30,4 +30,4 @@ add_custom_command(TARGET maputil POST_BUILD copy_mingw_dlls(maputil) add_loader_path_to_rpath(maputil) -install(TARGETS maputil RUNTIME DESTINATION .) +install(TARGETS maputil RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/qbsp/CMakeLists.txt b/qbsp/CMakeLists.txt index ee52b6eb8..c6105ef23 100644 --- a/qbsp/CMakeLists.txt +++ b/qbsp/CMakeLists.txt @@ -38,7 +38,7 @@ target_link_libraries(libqbsp common ${CMAKE_THREAD_LIBS_INIT} TBB::tbb TBB::tbb add_executable(qbsp main.cc) target_link_libraries(qbsp libqbsp) -install(TARGETS qbsp RUNTIME DESTINATION .) +install(TARGETS qbsp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) # HACK: copy .dll dependencies add_custom_command(TARGET qbsp POST_BUILD diff --git a/vis/CMakeLists.txt b/vis/CMakeLists.txt index 3a51e09bf..d1838ddcf 100644 --- a/vis/CMakeLists.txt +++ b/vis/CMakeLists.txt @@ -29,4 +29,4 @@ add_custom_command(TARGET vis POST_BUILD copy_mingw_dlls(vis) add_loader_path_to_rpath(vis) -install(TARGETS vis RUNTIME DESTINATION .) +install(TARGETS vis RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) From 8f32f801a703191206918930e8308ae5da404872 Mon Sep 17 00:00:00 2001 From: Jon Daniel Date: Sat, 31 May 2025 00:25:33 +0200 Subject: [PATCH 2/4] add ENABLE_PREFIX_INSTALL option --- CMakeLists.txt | 5 +++++ bsputil/CMakeLists.txt | 4 ++++ light/CMakeLists.txt | 11 ++++++++++- lightpreview/CMakeLists.txt | 4 ++++ maputil/CMakeLists.txt | 4 ++++ qbsp/CMakeLists.txt | 4 ++++ vis/CMakeLists.txt | 4 ++++ 7 files changed, 35 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e75213504..c35cd6b22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,6 +181,7 @@ add_subdirectory(qbsp) add_subdirectory(vis) add_subdirectory(maputil) +option(ENABLE_PREFIX_INSTALL "Enable Prefix install" ON) option(DISABLE_TESTS "Disables Tests" OFF) option(DISABLE_DOCS "Disables Docs" OFF) option(ENABLE_LIGHTPREVIEW "Enable light preview tool" ON) @@ -204,7 +205,11 @@ if(NOT DISABLE_DOCS) add_subdirectory(docs) endif () +if(ENABLE_INSTALL_PREFIX) install(FILES README.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) +else +install(FILES README.md DESTINATION .) +endif #CPack configuration diff --git a/bsputil/CMakeLists.txt b/bsputil/CMakeLists.txt index 2765ace3d..1001ae467 100644 --- a/bsputil/CMakeLists.txt +++ b/bsputil/CMakeLists.txt @@ -17,4 +17,8 @@ add_custom_command(TARGET bsputil POST_BUILD copy_mingw_dlls(bsputil) add_loader_path_to_rpath(bsputil) +if(ENABLE_PREFIX_INSTALL) install(TARGETS bsputil RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +else +install(TARGETS bsputil RUNTIME DESTINATION .) +endif() diff --git a/light/CMakeLists.txt b/light/CMakeLists.txt index a1758df08..533d08549 100644 --- a/light/CMakeLists.txt +++ b/light/CMakeLists.txt @@ -92,7 +92,11 @@ if (embree_FOUND) endif() if(NOT SKIP_EMBREE_INSTALL) - install(FILES $ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + if(ENABLE_PREFIX_INSTALL) + install(FILES $ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + else + install(FILES $ DESTINATION .) + endif() endif() # install TBB @@ -140,5 +144,10 @@ endif(embree_FOUND) copy_mingw_dlls(light) add_loader_path_to_rpath(light) +if(ENABLE_PREFIX_INSTALL) install(TARGETS light RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES ../gpl_v3.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}) +else +install(TARGETS light RUNTIME DESTINATION .) +install(FILES ../gpl_v3.txt DESTINATION .) +endif() diff --git a/lightpreview/CMakeLists.txt b/lightpreview/CMakeLists.txt index 6cd31d33c..febb7edd3 100644 --- a/lightpreview/CMakeLists.txt +++ b/lightpreview/CMakeLists.txt @@ -111,4 +111,8 @@ if (APPLE) apple_install_lib(Qt5::DBus "$/QtDBus.framework/Versions/5") endif () +if(ENABLE_PREFIX_INSTALL) install(TARGETS lightpreview RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}) +else +install(TARGETS lightpreview RUNTIME DESTINATION . BUNDLE DESTINATION .) +endif() diff --git a/maputil/CMakeLists.txt b/maputil/CMakeLists.txt index 8fd47bb06..e2af7fa44 100644 --- a/maputil/CMakeLists.txt +++ b/maputil/CMakeLists.txt @@ -30,4 +30,8 @@ add_custom_command(TARGET maputil POST_BUILD copy_mingw_dlls(maputil) add_loader_path_to_rpath(maputil) +if(ENABLE_PREFIX_INSTALL) install(TARGETS maputil RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +else +install(TARGETS maputil RUNTIME DESTINATION .) +endif() diff --git a/qbsp/CMakeLists.txt b/qbsp/CMakeLists.txt index c6105ef23..2b4b1fa45 100644 --- a/qbsp/CMakeLists.txt +++ b/qbsp/CMakeLists.txt @@ -38,7 +38,11 @@ target_link_libraries(libqbsp common ${CMAKE_THREAD_LIBS_INIT} TBB::tbb TBB::tbb add_executable(qbsp main.cc) target_link_libraries(qbsp libqbsp) +if(ENABLE_PREFIX_INSTALL) install(TARGETS qbsp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +else +install(TARGETS qbsp RUNTIME DESTINATION .) +endif() # HACK: copy .dll dependencies add_custom_command(TARGET qbsp POST_BUILD diff --git a/vis/CMakeLists.txt b/vis/CMakeLists.txt index d1838ddcf..3b909ead4 100644 --- a/vis/CMakeLists.txt +++ b/vis/CMakeLists.txt @@ -29,4 +29,8 @@ add_custom_command(TARGET vis POST_BUILD copy_mingw_dlls(vis) add_loader_path_to_rpath(vis) +if(ENABLE_PREFIX_INSTALLL) install(TARGETS vis RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +else +install(TARGETS vis RUNTIME DESTINATION .) +endif() From c35766ec8f266a22dc2aa5e9702e070af5597f4a Mon Sep 17 00:00:00 2001 From: Jon Daniel Date: Sat, 31 May 2025 14:04:13 +0200 Subject: [PATCH 3/4] add ENABLE_PREFIX_INSTALL option --- CMakeLists.txt | 9 +++++---- bspinfo/CMakeLists.txt | 4 ++++ bsputil/CMakeLists.txt | 2 +- docs/CMakeLists.txt | 5 +++++ light/CMakeLists.txt | 4 ++-- lightpreview/CMakeLists.txt | 2 +- maputil/CMakeLists.txt | 2 +- qbsp/CMakeLists.txt | 2 +- vis/CMakeLists.txt | 4 ++-- 9 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c35cd6b22..76dcb792e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,6 +172,8 @@ set(TEST_QUAKE2_MAP_EXPORT_DIR "" CACHE PATH "When running unit tests, export Qu set(TEST_HEXEN2_MAP_EXPORT_DIR "" CACHE PATH "When running unit tests, export Hexen 2 maps to this directory (useful for testing in game)") set(TEST_HALFLIFE_MAP_EXPORT_DIR "" CACHE PATH "When running unit tests, export Half-Life maps to this directory (useful for testing in game)") +option(ENABLE_PREFIX_INSTALL "Enable Prefix install" OFF) + add_subdirectory(3rdparty) add_subdirectory(common) add_subdirectory(bspinfo) @@ -181,7 +183,6 @@ add_subdirectory(qbsp) add_subdirectory(vis) add_subdirectory(maputil) -option(ENABLE_PREFIX_INSTALL "Enable Prefix install" ON) option(DISABLE_TESTS "Disables Tests" OFF) option(DISABLE_DOCS "Disables Docs" OFF) option(ENABLE_LIGHTPREVIEW "Enable light preview tool" ON) @@ -205,11 +206,11 @@ if(NOT DISABLE_DOCS) add_subdirectory(docs) endif () -if(ENABLE_INSTALL_PREFIX) +if(ENABLE_PREFIX_INSTALL) install(FILES README.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) -else +else() install(FILES README.md DESTINATION .) -endif +endif () #CPack configuration diff --git a/bspinfo/CMakeLists.txt b/bspinfo/CMakeLists.txt index c4cf4c11b..4e20401ce 100644 --- a/bspinfo/CMakeLists.txt +++ b/bspinfo/CMakeLists.txt @@ -9,4 +9,8 @@ add_custom_command(TARGET bspinfo POST_BUILD copy_mingw_dlls(bspinfo) add_loader_path_to_rpath(bspinfo) +if(ENABLE_PREFIX_INSTALL) install(TARGETS bspinfo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +else() +install(TARGETS bspinfo RUNTIME DESTINATION .) +endif() diff --git a/bsputil/CMakeLists.txt b/bsputil/CMakeLists.txt index 1001ae467..7ed88d3d7 100644 --- a/bsputil/CMakeLists.txt +++ b/bsputil/CMakeLists.txt @@ -19,6 +19,6 @@ add_loader_path_to_rpath(bsputil) if(ENABLE_PREFIX_INSTALL) install(TARGETS bsputil RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -else +else() install(TARGETS bsputil RUNTIME DESTINATION .) endif() diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 6a806f9e8..ffb49905c 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -14,5 +14,10 @@ if (Sphinx_FOUND) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating documentation with Sphinx") +if(ENABLE_PREFIX_INSTALL) install(DIRECTORY ${SPHINX_BUILD}/ DESTINATION ${CMAKE_INSTALL_DOCDIR}) +else() + install(DIRECTORY ${SPHINX_BUILD}/ DESTINATION doc) +endif() + endif() diff --git a/light/CMakeLists.txt b/light/CMakeLists.txt index 533d08549..0334d672a 100644 --- a/light/CMakeLists.txt +++ b/light/CMakeLists.txt @@ -94,7 +94,7 @@ if (embree_FOUND) if(NOT SKIP_EMBREE_INSTALL) if(ENABLE_PREFIX_INSTALL) install(FILES $ DESTINATION ${CMAKE_INSTALL_LIBDIR}) - else + else() install(FILES $ DESTINATION .) endif() endif() @@ -147,7 +147,7 @@ add_loader_path_to_rpath(light) if(ENABLE_PREFIX_INSTALL) install(TARGETS light RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES ../gpl_v3.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}) -else +else() install(TARGETS light RUNTIME DESTINATION .) install(FILES ../gpl_v3.txt DESTINATION .) endif() diff --git a/lightpreview/CMakeLists.txt b/lightpreview/CMakeLists.txt index febb7edd3..b7c6067c1 100644 --- a/lightpreview/CMakeLists.txt +++ b/lightpreview/CMakeLists.txt @@ -113,6 +113,6 @@ endif () if(ENABLE_PREFIX_INSTALL) install(TARGETS lightpreview RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}) -else +else() install(TARGETS lightpreview RUNTIME DESTINATION . BUNDLE DESTINATION .) endif() diff --git a/maputil/CMakeLists.txt b/maputil/CMakeLists.txt index e2af7fa44..a22a6bb05 100644 --- a/maputil/CMakeLists.txt +++ b/maputil/CMakeLists.txt @@ -32,6 +32,6 @@ add_loader_path_to_rpath(maputil) if(ENABLE_PREFIX_INSTALL) install(TARGETS maputil RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -else +else() install(TARGETS maputil RUNTIME DESTINATION .) endif() diff --git a/qbsp/CMakeLists.txt b/qbsp/CMakeLists.txt index 2b4b1fa45..595cce212 100644 --- a/qbsp/CMakeLists.txt +++ b/qbsp/CMakeLists.txt @@ -40,7 +40,7 @@ target_link_libraries(qbsp libqbsp) if(ENABLE_PREFIX_INSTALL) install(TARGETS qbsp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -else +else() install(TARGETS qbsp RUNTIME DESTINATION .) endif() diff --git a/vis/CMakeLists.txt b/vis/CMakeLists.txt index 3b909ead4..20ea3a005 100644 --- a/vis/CMakeLists.txt +++ b/vis/CMakeLists.txt @@ -29,8 +29,8 @@ add_custom_command(TARGET vis POST_BUILD copy_mingw_dlls(vis) add_loader_path_to_rpath(vis) -if(ENABLE_PREFIX_INSTALLL) +if(ENABLE_PREFIX_INSTALL) install(TARGETS vis RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -else +else() install(TARGETS vis RUNTIME DESTINATION .) endif() From 7c7d4154e5f71a7a59143a8d899ec674c0205dc8 Mon Sep 17 00:00:00 2001 From: Jon Daniel Date: Sat, 31 May 2025 14:07:01 +0200 Subject: [PATCH 4/4] add Makefile again --- .gitignore | 1 - docs/Makefile | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 docs/Makefile diff --git a/.gitignore b/.gitignore index 51095fef1..17b51d3e4 100644 --- a/.gitignore +++ b/.gitignore @@ -85,7 +85,6 @@ CTestTestfile.cmake docs/CTestTestConfig.cmake docs/CTestTestfile.cmake docs/cmake_install.cmake -docs/Makefile docs/CMakeFiles/ docs/CMakeCache.txt lib/lib* diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 000000000..d4bb2cbb9 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)