easyLetter/Makefile

39 lines
832 B
Makefile
Raw Permalink Normal View History

2023-12-13 18:37:36 +01:00
NAME = _letter
TEX = $(NAME).tex
FULLNAME = Lettre
2023-03-23 09:55:27 +01:00
2023-03-25 02:46:33 +01:00
DIRECTORIES = $(filter-out "." ".git",$(shell find . -maxdepth 1 -type d -printf "\"%f\" "))
2023-03-23 09:55:27 +01:00
TEMPLATE = Template
2024-04-20 15:37:14 +02:00
TEXMK = latexmk -lualatex -interaction=nonstopmode
2024-04-26 11:02:54 +02:00
QPDF = qpdf --linearize --replace-input
2023-12-13 18:37:36 +01:00
RM = rm -f
CP = cp -r
2023-03-23 09:55:27 +01:00
all: build
2023-12-13 18:37:36 +01:00
new:
@echo Nom du dossier ?
@read line; echo $$line | xargs -i $(CP) '$(TEMPLATE)' {}/
2023-03-23 09:55:27 +01:00
build:
2023-03-25 02:46:33 +01:00
@for dir in $(filter-out "$(TEMPLATE)",$(DIRECTORIES)); do \
2023-03-23 09:55:27 +01:00
cd "$$dir"; \
2023-03-25 03:20:16 +01:00
$(TEXMK) "$(TEX)"; \
2024-04-26 11:02:54 +02:00
$(QPDF) "$(NAME).pdf" 2>/dev/null |:; \
2023-03-23 09:55:27 +01:00
mv $(NAME).pdf "../$(FULLNAME)-$$dir.pdf"; \
cd ..; \
done;
2023-12-13 18:37:36 +01:00
EXTS = aux log tns fdb_latexmk fls synctex.gz pdf out
clean:
@for dir in $(DIRECTORIES); do \
cd "$$dir"; \
$(RM) $(foreach e,$(EXTS),$(NAME).$(e)); \
cd ..; \
done;
clean-full:
$(MAKE) clean
$(RM) *.pdf