/[skencil]/website/trunk/gallery/Makefile
ViewVC logotype

Annotation of /website/trunk/gallery/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 642 - (hide annotations)
Sat Oct 29 22:00:18 2005 UTC (19 years, 4 months ago) by bh
Original Path: website/trunk/skencil.org/gallery/Makefile
File size: 3310 byte(s)
Make sure waratah can actually be built by make

1 jpaalasm 607 # Makefile for the Gallery images on the Sketch homepage
2     #
3    
4     # All the gallery files are generated from pairs of sk-files and readme
5     # files. The rendering process involves relatively large intermediate
6     # PPM files which are not automatically removed. You may want to do that
7     # by hand occasionally.
8    
9     # Directory where the .sk and .readme files can be found
10     SRCDIR = src
11    
12     #
13     # Tools Configuration
14     #
15    
16     # program to convert .sk files to ppm
17     SK2PPM = sk2ppm
18    
19     # program to convert ppm to jpeg
20     CJPEG = cjpeg
21    
22     # program to scale a ppm file
23     PNMSCALE = pnmscale
24    
25     # The Gallery images. These are the basenames of the .sk and .readme
26     # files in $(SRCDIR). They're grouped by artist with MISC as the catch
27     # all.
28     APASCUAL = coco nana portrait SimcaSP moniteur Affiche4 Distribution Simca8
29     WOJTKIEWICZ = bathead fruitscene kapelusznica
30     HARA = trem01 raposa
31     TATANE = avion cartes compo helicoptere photo pomme vache
32     BIDDIER = southern_bell southern_cop smile_n_jack under_da_sea
33 bh 642 THILBRICHT = waratah
34 jpaalasm 607 MISC = bsddaemon stay_with_us penguin sun
35    
36     # list of all drawing basenames to process
37 bernhard 628 DRAWINGS = $(APASCUAL) $(WOJTKIEWICZ) $(HARA) $(TATANE) $(BIDDIER) $(MISC) $(THILBRICHT)
38 jpaalasm 607
39     # list of all the tarfiles
40     TARFILES = $(DRAWINGS:%=%.tar.gz)
41     # list of all the jpg images
42     IMAGES = $(DRAWINGS:%=%.jpg)
43    
44     # Resolution of the rendered .sk files in ppi
45     FULL_RESOLUTION = 144
46    
47     # number of gradient steps when rendering
48     GRADIENT_STEPS = 100
49    
50     # Command to scale the rendered PPM file to a more suitable size for the
51     # full image
52     FULL_SCALE = $(PNMSCALE) 0.4
53    
54     # scale factor for the preview thumbnail
55     PREVIEW_FACTOR = -height 150
56    
57     # cjpeg options for the full-scale images
58     LARGE_JPEG_OPTS = -quality 80
59    
60     # Some images need some special options or extra processing. To
61     # facilitate this, the makefile uses variables with the form
62     # <basename>_sk2ppmopt and <basename>_previewfilter. <basename> is the
63     # basename of the sk-file being processed.
64     #
65     # The *_sk2ppmopt variables control the rendering of sk-files to ppm.
66     # Normally, the bounding box of an image determines the region of the
67     # drawing that is rendered. If the *_sk2ppmopt variable's value is page,
68     # then the page is used as the region.
69     #
70     # The *_previewfilter are an additional filtering step for the generated
71     # previews. Their value should be a command that accepts a PPM file on
72     # stdin and writes a PPM file to stdout. The command should end in a
73     # pipe symbol. The output is the input to the cjpeg program which writes
74     # the preview image.
75     coco_sk2ppmopt = page
76     moniteur_previewfilter = pnmcrop -black |
77     coco_previewfilter = pnmcrop -black |
78     bathead_previewfilter = pnmcrop -black |
79    
80    
81     # the intermediate ppm files should not be removed automatically because
82     # they're relatively expensive to create.
83     .PRECIOUS: %.ppm
84    
85     all: $(IMAGES) $(TARFILES)
86    
87     %.jpg: %.ppm
88     $(PNMSCALE) $(PREVIEW_FACTOR) $< | $($*_previewfilter) \
89     $(CJPEG) > small$@ \
90     || rm -f small$@
91     $(FULL_SCALE) $< | $(CJPEG) $(LARGE_JPEG_OPTS) > $@ || rm -f $@
92    
93     %.ppm: $(SRCDIR)/%.sk
94     $(SK2PPM) --resolution=$(FULL_RESOLUTION) \
95     --gradient-steps=$(GRADIENT_STEPS) \
96     $(shell if [ "$($*_sk2ppmopt)" == "page" ]; \
97     then echo ''; else echo '--bbox'; fi) \
98     $< $@
99    
100     %.tar.gz: $(SRCDIR)/%.sk $(SRCDIR)/%.readme
101     tar cvzf $@ $^
102    
103    
104    
105     clean:
106     rm -f $(IMAGES) $(IMAGES:%=small%) $(TARFILES)
107    
108     clobber: clean
109     rm -f *.ppm

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26