Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
#!/usr/bin/make -f # # This file: # http://angg.twu.net/bin/djvuize.html # http://angg.twu.net/bin/djvuize # (find-angg "bin/djvuize") # # This is a makefile that I use to convert JPGs - usually photos of # whiteboards - to black-and-white PNGs, and then to single-page # DJVUs, then to a many-page DJVU, then to a many-page PDF. Each of # the courses that I teach has a directory with photos of its # whiteboards and with a makefile based on this one, and I use that # makefile to produces a single-file printable PDF version of its # whiteboards. For example: # # http://angg.twu.net/2019.1-C2.html # http://angg.twu.net/2019.1-C2/ # http://angg.twu.net/2019.1-C2/Makefile.html # http://angg.twu.net/2019.1-C2/Makefile # http://angg.twu.net/2019.1-C2/2019.1-C2.pdf # (find-angg "2019.2-C2/Makefile") # # This was based on: # (find-angg "SCANS/Makefile") # # See: (find-node "(make)Text Functions") default: @echo Hello THIS = all PNGS = $(patsubst %.jpg,%.png,$(wildcard *.jpg)) DJVUS = $(patsubst %.png,%.djvu,$(wildcard *.png)) # (find-angg "bin/whiteboard") # (find-es "gimp" "whiteboard") pngs_: echo $(PNGS) pngs: $(PNGS) %.png: %.jpg whiteboard $(WHITEBOARDOPTS) $< $@ %.pgm: %.png convert $< $@ %.pbm: %.pgm mkbitmap -x -f 50 -t 0.4 $< -o $@ %.djvu: %.pbm cjb2 -lossy $< $@ djvus_: echo $(DJVUS) djvus: $(DJVUS) djvu: $(THIS).djvu $(THIS).djvu: $(DJVUS) djvm -create $(THIS).djvu $(DJVUS) pdf: $(THIS).pdf %.pdf: %.djvu ddjvu -format=pdf $< $@