easyLetter/Makefile

36 lines
730 B
Makefile
Raw Normal View History

2023-03-23 09:55:27 +01:00
NAME = _letter
TEX = $(NAME).tex
FULLNAME = Lettre
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
TEMP_FILES = aux log tns fdb_latexmk fls synctex.gz pdf out
TEMPLATE = Template
RM = rm -f
CP = cp -r
all: build
clean:
2023-03-23 10:00:11 +01:00
@for dir in $(DIRECTORIES); do \
2023-03-23 09:55:27 +01:00
cd "$$dir"; \
2023-03-25 02:46:33 +01:00
$(RM) $(foreach i,$(TEMP_FILES),$(NAME).$(i)); \
2023-03-23 09:55:27 +01:00
cd ..; \
done;
clean-full:
$(MAKE) clean
$(RM) *.pdf
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"; \
pdflatex $(TEX); \
mv $(NAME).pdf "../$(FULLNAME)-$$dir.pdf"; \
cd ..; \
done;
new:
@echo Nom du dossier ?
@read line; echo $$line | xargs -i $(CP) '$(TEMPLATE)' {}/