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

Annotation of /website/trunk/gallery/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 607 - (hide annotations)
Thu Mar 25 17:51:26 2004 UTC (20 years, 11 months ago) by jpaalasm
Original Path: website/trunk/skencil.org/gallery/Makefile
File size: 3275 byte(s)
Adding files to repository.

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     MISC = bsddaemon stay_with_us penguin sun
34    
35     # list of all drawing basenames to process
36     DRAWINGS = $(APASCUAL) $(WOJTKIEWICZ) $(HARA) $(TATANE) $(BIDDIER) $(MISC)
37    
38     # list of all the tarfiles
39     TARFILES = $(DRAWINGS:%=%.tar.gz)
40     # list of all the jpg images
41     IMAGES = $(DRAWINGS:%=%.jpg)
42    
43     # Resolution of the rendered .sk files in ppi
44     FULL_RESOLUTION = 144
45    
46     # number of gradient steps when rendering
47     GRADIENT_STEPS = 100
48    
49     # Command to scale the rendered PPM file to a more suitable size for the
50     # full image
51     FULL_SCALE = $(PNMSCALE) 0.4
52    
53     # scale factor for the preview thumbnail
54     PREVIEW_FACTOR = -height 150
55    
56     # cjpeg options for the full-scale images
57     LARGE_JPEG_OPTS = -quality 80
58    
59     # Some images need some special options or extra processing. To
60     # facilitate this, the makefile uses variables with the form
61     # <basename>_sk2ppmopt and <basename>_previewfilter. <basename> is the
62     # basename of the sk-file being processed.
63     #
64     # The *_sk2ppmopt variables control the rendering of sk-files to ppm.
65     # Normally, the bounding box of an image determines the region of the
66     # drawing that is rendered. If the *_sk2ppmopt variable's value is page,
67     # then the page is used as the region.
68     #
69     # The *_previewfilter are an additional filtering step for the generated
70     # previews. Their value should be a command that accepts a PPM file on
71     # stdin and writes a PPM file to stdout. The command should end in a
72     # pipe symbol. The output is the input to the cjpeg program which writes
73     # the preview image.
74     coco_sk2ppmopt = page
75     moniteur_previewfilter = pnmcrop -black |
76     coco_previewfilter = pnmcrop -black |
77     bathead_previewfilter = pnmcrop -black |
78    
79    
80     # the intermediate ppm files should not be removed automatically because
81     # they're relatively expensive to create.
82     .PRECIOUS: %.ppm
83    
84     all: $(IMAGES) $(TARFILES)
85    
86     %.jpg: %.ppm
87     $(PNMSCALE) $(PREVIEW_FACTOR) $< | $($*_previewfilter) \
88     $(CJPEG) > small$@ \
89     || rm -f small$@
90     $(FULL_SCALE) $< | $(CJPEG) $(LARGE_JPEG_OPTS) > $@ || rm -f $@
91    
92     %.ppm: $(SRCDIR)/%.sk
93     $(SK2PPM) --resolution=$(FULL_RESOLUTION) \
94     --gradient-steps=$(GRADIENT_STEPS) \
95     $(shell if [ "$($*_sk2ppmopt)" == "page" ]; \
96     then echo ''; else echo '--bbox'; fi) \
97     $< $@
98    
99     %.tar.gz: $(SRCDIR)/%.sk $(SRCDIR)/%.readme
100     tar cvzf $@ $^
101    
102    
103    
104     clean:
105     rm -f $(IMAGES) $(IMAGES:%=small%) $(TARFILES)
106    
107     clobber: clean
108     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