diff --git a/Makefile b/Makefile index 1ee15d8..99cccd5 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,30 @@ +# Makefile for latex-packages + +BUILD_DIR=build +DOC_SUBDIR=doc +PACKAGES_SUBDIR=packages +COMPILE_SUBDIR=.compile BUILD_FLAGS=--recursive --git-version --pytex-version --license --author "Maximilian Keßler" --pytex-info-text --extra-header ".build/header_info.txt" --name "prepend-author" --clean-old-files -BUILD_DIRS= --source-dir src --build-dir build +ROOT=$(shell pwd) +BUILD_ROOT=${ROOT}/${BUILD_DIR} + + +# Build packages build: .initsubmodulelock - @python3 build.py ${BUILD_DIRS} ${BUILD_FLAGS} + python3 build.py --source-dir src --build-dir ${BUILD_ROOT}/${PACKAGES_SUBDIR} ${BUILD_FLAGS} +# Build packages and allow repo to be dirty (use with caution and only when developing) dirty: .initsubmodulelock - @python3 build.py ${BUILD_DIRS} ${BUILD_FLAGS} --allow-dirty + python3 build.py --source-dir src --build-dir ${BUILD_ROOT}/${PACKAGES_SUBDIR} ${BUILD_FLAGS} --allow-dirty +# generate documentation files from /doc +doc: + @scripts/compile_doc.sh + @mkdir -p ${BUILD_ROOT}/${DOC_SUBDIR} + @cp .compile/*.pdf ${BUILD_ROOT}/${DOC_SUBDIR} + @echo Documentation files written to ${BUILD_ROOT}/${DOC_SUBDIR} + init: .initsubmodulelock .gitconfiglock config: .gitconfiglock @@ -27,12 +45,9 @@ all: clean build clean: @-rm -r build/ - -ci-build: - @python3 build.py --source-dir src --build-dir build/LatexPackagesBuild ${BUILD_FLAGS} - -doc: - @-rm -r build/documentation - $(MAKE) -C doc central-doc + @-rm -r .compile/ .PHONY: build doc +#!/bin/bash +# Compiles all correspondence letters in repository + diff --git a/doc/DIR_MAKEFILE b/doc/DIR_MAKEFILE deleted file mode 100644 index a80927d..0000000 --- a/doc/DIR_MAKEFILE +++ /dev/null @@ -1,12 +0,0 @@ -TOPTARGETS := all clean doc full central-doc - -SUBDIRS := $(wildcard */.) - -$(TOPTARGETS): $(SUBDIRS) -$(SUBDIRS): - $(MAKE) -C $@ $(MAKECMDGOALS) - -central-doc: $(SUBDIRS) - mv *.pdf .. - -.PHONY: $(TOPTARGETS) $(SUBDIRS) diff --git a/doc/DOC_MAKEFILE b/doc/DOC_MAKEFILE deleted file mode 100644 index 12fbda1..0000000 --- a/doc/DOC_MAKEFILE +++ /dev/null @@ -1,11 +0,0 @@ -doc: - latexmk - -full: - latexmk -gg - -clean: - latexmk -C - -central-doc: full - mv *.pdf .. diff --git a/doc/LATEXMKRC b/doc/LATEXMKRC index 31479be..c8448fc 100644 --- a/doc/LATEXMKRC +++ b/doc/LATEXMKRC @@ -1,3 +1,10 @@ +# This is the .latexmkrc file that needs to be used for compiling the documentation +# Note that the makeindex command is non-standard and follows the LaTeX3 architecture +# Without this, generating the indexes properly will not work and leads to compiling +# errors. +# When adding new packages, this should be symlinked to in each new directory, +# so that a call to latexmk will automatically use these options + $makeindex = 'makeindex -s gind.ist %O -o %D %S'; $clean_ext .= ' glo'; $clean_ext .= ' hd'; diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index 16e761d..0000000 --- a/doc/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -TOPTARGETS := all clean doc full central-doc - -SUBDIRS := $(wildcard */.) - -$(TOPTARGETS): $(SUBDIRS) -$(SUBDIRS): - $(MAKE) -C $@ $(MAKECMDGOALS) - -central-doc: $(SUBDIRS) - mkdir -p ../build/documentation - mv *.pdf ../build/documentation - -.PHONY: $(TOPTARGETS) $(SUBDIRS) diff --git a/doc/environments/Makefile b/doc/environments/Makefile deleted file mode 120000 index 63f6ffd..0000000 --- a/doc/environments/Makefile +++ /dev/null @@ -1 +0,0 @@ -../DIR_MAKEFILE \ No newline at end of file diff --git a/doc/environments/fancythm/Makefile b/doc/environments/fancythm/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/environments/fancythm/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/environments/groupthm/Makefile b/doc/environments/groupthm/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/environments/groupthm/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/environments/refproof/Makefile b/doc/environments/refproof/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/environments/refproof/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/environments/thmstyle/Makefile b/doc/environments/thmstyle/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/environments/thmstyle/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/indexing/Makefile b/doc/indexing/Makefile deleted file mode 120000 index 63f6ffd..0000000 --- a/doc/indexing/Makefile +++ /dev/null @@ -1 +0,0 @@ -../DIR_MAKEFILE \ No newline at end of file diff --git a/doc/indexing/symbindex/Makefile b/doc/indexing/symbindex/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/indexing/symbindex/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/indexing/vocab/Makefile b/doc/indexing/vocab/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/indexing/vocab/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/math/Makefile b/doc/math/Makefile deleted file mode 120000 index 63f6ffd..0000000 --- a/doc/math/Makefile +++ /dev/null @@ -1 +0,0 @@ -../DIR_MAKEFILE \ No newline at end of file diff --git a/doc/math/categories/Makefile b/doc/math/categories/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/math/categories/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/math/faktor/Makefile b/doc/math/faktor/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/math/faktor/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/math/mathalias/Makefile b/doc/math/mathalias/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/math/mathalias/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/math/mathfig/Makefile b/doc/math/mathfig/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/math/mathfig/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/math/mathfixes/Makefile b/doc/math/mathfixes/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/math/mathfixes/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/math/mathfont/Makefile b/doc/math/mathfont/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/math/mathfont/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/math/mathop/Makefile b/doc/math/mathop/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/math/mathop/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/math/mathsymb/Makefile b/doc/math/mathsymb/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/math/mathsymb/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/wrappers/Makefile b/doc/wrappers/Makefile deleted file mode 120000 index 63f6ffd..0000000 --- a/doc/wrappers/Makefile +++ /dev/null @@ -1 +0,0 @@ -../DIR_MAKEFILE \ No newline at end of file diff --git a/doc/wrappers/enumerate/Makefile b/doc/wrappers/enumerate/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/wrappers/enumerate/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/wrappers/hypersetup/Makefile b/doc/wrappers/hypersetup/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/wrappers/hypersetup/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/wrappers/incfig/Makefile b/doc/wrappers/incfig/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/wrappers/incfig/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/wrappers/math/Makefile b/doc/wrappers/math/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/wrappers/math/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/wrappers/todo/Makefile b/doc/wrappers/todo/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/wrappers/todo/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/doc/wrappers/unicodechar/Makefile b/doc/wrappers/unicodechar/Makefile deleted file mode 120000 index 7038012..0000000 --- a/doc/wrappers/unicodechar/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../DOC_MAKEFILE \ No newline at end of file diff --git a/scripts/compile_doc.sh b/scripts/compile_doc.sh new file mode 100755 index 0000000..759a6d6 --- /dev/null +++ b/scripts/compile_doc.sh @@ -0,0 +1,5 @@ +#! /bin/bash +# Compiles all documentation files in repository +BUILD_COMMAND="latexmk -output-directory=$(pwd)/.compile $1" + +find doc -type f -name "*.tex" -execdir sh -c "$BUILD_COMMAND" -- {} \; diff --git a/src/environments/fancythm/Makefile b/src/environments/fancythm/Makefile deleted file mode 100644 index d59b981..0000000 --- a/src/environments/fancythm/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -pdf: - latexmk - -full: - latexmk -gg - -clean: - latexmk -C - -.PHONY: clean diff --git a/src/environments/groupthm/Makefile b/src/environments/groupthm/Makefile deleted file mode 100644 index 4e0d5d2..0000000 --- a/src/environments/groupthm/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -pdf: - latexmk - -full: - latexmk -gg - -clean: - latexmk -C - -.PHONY: clean diff --git a/src/environments/thmstyle/Makefile b/src/environments/thmstyle/Makefile deleted file mode 100644 index 4e0d5d2..0000000 --- a/src/environments/thmstyle/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -pdf: - latexmk - -full: - latexmk -gg - -clean: - latexmk -C - -.PHONY: clean