milewski-ctfp-pdf/Makefile
Pol Dellaiera de799935b2
refactor: CI and nix (#306)
* fix: remove custom fonts

Since they are available in Nix, there is no need to keep them in the project anymore

* chore: remove old obsolete files

* refactor: rewrite Nix files

- Switch from `numtide/flake-utils` to `flake-parts`
- Add custom font derivation for LaTeX
- Add `formatter`
- Switch to `python311`

* ci: update Github workflows

* feat: add `Makefile` for local development

Very useful when used in combination with `nix develop`

* feat: add `.envrc` file for loading development environment with `nix-direnv`

* feat: add `.editorconfig` and `.prettierrc`

* style: reformat files using `prettier`

Run `nix run nixpkgs#nodePackages.prettier -- --write .`

* fix: add workaround to prevent bug with `minted` package

see https://github.com/gpoore/minted/issues/353 for context

* fix: add `version.tex` in the repo

* chore: rewrite `README`

* chore: ignore LaTeX temporary files while building locally

* feat: add `latexindent.pl` configuration file

* style: lint LaTeX files
2023-02-02 10:53:45 +01:00

32 lines
1.1 KiB
Makefile

OUTPUT ?= $(shell basename "$(shell dirname "$(INPUT)")")
OUTPUT_DIRECTORY = $(shell pwd)/build
LATEXMK_ARGS ?= -f -file-line-error -shell-escape -logfilewarninglist -interaction=nonstopmode -halt-on-error -norc -pdflatex="xelatex %O %S" -pdfxe
TEXINPUTS = ""
TEXLIVE_RUN = TEXINPUTS=$(TEXINPUTS)
LATEXMK_COMMAND = $(TEXLIVE_RUN) latexmk $(LATEXMK_ARGS)
# Make does not offer a recursive wildcard function, so here's one:
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
ctfp:
cd src; $(LATEXMK_COMMAND) -jobname=ctfp ctfp-reader.tex
ctfp-ocaml:
cd src; $(LATEXMK_COMMAND) -jobname=ctfp-ocaml ctfp-reader-ocaml.tex
ctfp-scala:
cd src; $(LATEXMK_COMMAND) -jobname=ctfp-scala ctfp-reader-scala.tex
ctfp-print:
cd src; $(LATEXMK_COMMAND) -jobname=ctfp-print ctfp-print.tex
ctfp-print-ocaml:
cd src; $(LATEXMK_COMMAND) -jobname=ctfp-print-ocaml ctfp-print-ocaml.tex
ctfp-print-scala:
cd src; $(LATEXMK_COMMAND) -jobname=ctfp-print-scala ctfp-print-scala.tex
lint:
$(foreach file, $(call rwildcard,$(shell dirname "$(INPUT)"),*.tex), latexindent -l -w $(file);)