Created
December 7, 2014 13:56
-
-
Save DamonOehlman/4462810d0626ea3f6cf8 to your computer and use it in GitHub Desktop.
A simple makefile to process a number of input png files into ebook optimised pdf files in a dist directory.
This file contains hidden or 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
inputfiles = $(patsubst %.png,dist/%.pdf,$(wildcard *.png)) | |
rebuild: clean build | |
build: prepare $(inputfiles) postbuild | |
dist/%.pdf: | |
@convert $(patsubst dist/%.pdf,%.png,$@) tmp/$@ | |
@gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -sOutputFile=$@ tmp/$@ | |
@rm tmp/$@ | |
prepare: | |
mkdir -p dist | |
mkdir -p tmp/dist | |
postbuild: | |
rm -rf tmp | |
clean: | |
rm -rf dist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment