Created
April 30, 2018 07:49
-
-
Save aflp91/dfe22eab0b992f00145b9e25b7ef2122 to your computer and use it in GitHub Desktop.
A Makefile to convert jpg to pdf and then concatenate (on MacOSX)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JPG = $(wildcard Orig/*.JPG) | |
PDF = $(patsubst Orig/%.JPG,%.pdf,$(JPG)) | |
CONCAT = "/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" | |
.PHONY: help clean all convert concat | |
.DEFAULT : | |
@$(MAKE) help | |
help: | |
@echo " convert convertit les .JPG en PDF" | |
@echo " concat rassemble les .PDF en un document" | |
@echo " all convertit puis génère le PDF final" | |
@echo " clean supprime les PDF générés, sauf le document final" | |
all: convert concat | |
convert : $(PDF) | |
%.pdf: Orig/%.JPG | |
sips -s format pdf $< --out $@ 1>/dev/null 2>&1 | |
concat: | |
$(CONCAT) -o combined.pdf *.pdf | |
clean: | |
rm $(PDF) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment