latex-packages/Makefile

54 lines
1.5 KiB
Makefile
Raw Normal View History

# Makefile for latex-packages
BUILD_DIR=build
DOC_SUBDIR=doc
PACKAGES_SUBDIR=packages
COMPILE_SUBDIR=.compile
2022-01-13 20:58:29 +01:00
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
2021-10-06 23:10:25 +02:00
ROOT=$(shell pwd)
BUILD_ROOT=${ROOT}/${BUILD_DIR}
# Build packages
2021-10-06 23:21:01 +02:00
build: .initsubmodulelock
python3 build.py --source-dir src --build-dir ${BUILD_ROOT}/${PACKAGES_SUBDIR} ${BUILD_FLAGS}
2021-10-24 10:35:53 +02:00
# Build packages and allow repo to be dirty (use with caution and only when developing)
2021-10-24 10:35:53 +02:00
dirty: .initsubmodulelock
python3 build.py --source-dir src --build-dir ${BUILD_ROOT}/${PACKAGES_SUBDIR} ${BUILD_FLAGS} --allow-dirty
2021-10-06 23:21:01 +02:00
# 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}
2021-10-06 23:21:01 +02:00
init: .initsubmodulelock .gitconfiglock
2021-10-07 09:01:50 +02:00
config: .gitconfiglock
2021-10-06 23:21:01 +02:00
.initsubmodulelock:
@git submodule update --init
@touch .initsubmodulelock
.gitconfiglock:
@echo "[Make config] Setting git configs to prevent wrong pushes"
@git config push.recurseSubmodules check
@git config status.submodulesummary 1
@echo "[Push annotated tags by default]"
@git config push.followTags true
@touch .gitconfiglock
2021-10-19 21:03:31 +02:00
2022-01-10 01:06:47 +01:00
all: clean build
2021-10-19 21:03:31 +02:00
clean:
2021-10-24 10:35:53 +02:00
@-rm -r build/
@-rm -r .compile/
2022-01-30 21:52:13 +01:00
.PHONY: build doc
#!/bin/bash
# Compiles all correspondence letters in repository