Makefile for DjVu


/ Published in: Makefile
Save to your folder(s)



Copy this code and paste it in your HTML
  1. .PHONY: djvu
  2. .SUFFIXES: .djvu .ppm .pbm .jpg .tiff .tif
  3.  
  4. DJVU_TARGET:=$(notdir $(CURDIR)).djvu
  5. DJVU_CHUNKS:=$(sort $(patsubst %.jpg,%.djvu,$(wildcard *.jpg)) $(patsubst %.pbm,%.djvu,$(wildcard *.pbm)) $(patsubst %.ppm,%.djvu,$(wildcard *.ppm)))
  6.  
  7. DJVUFLAGS?=-dpi 300 -colors 4 -bgwhite
  8. PBM2DJVU:=cjb2 -dpi 300 -clean -loose
  9. #PBM2DJVU:=minidjvu -l -d 300
  10.  
  11. djvu: $(DJVU_TARGET)
  12.  
  13. $(DJVU_TARGET): $(DJVU_CHUNKS)
  14. djvm -c $@ $^
  15.  
  16. %.djvu: %.jpg
  17. c44 -dpi 96 $^ $@
  18.  
  19. %.djvu: %.pbm
  20. $(PBM2DJVU) $^ $@
  21.  
  22. %.djvu: %.ppm
  23. cpaldjvu $(DJVUFLAGS) $^ $@
  24.  
  25. %.djvu: %.tiff
  26. cpaldjvu $(DJVUFLAGS) $^ $@
  27.  
  28. %.djvu: %.tif
  29. cpaldjvu $(DJVUFLAGS) $^ $@

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.