aboutsummaryrefslogtreecommitdiffhomepage
path: root/images/Makefile
blob: 90b156600a5526a79b8a9b9870859c251474fefc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
##
## Makefile for Proof General images directory.
## 
## Author:   David Aspinall <da@dcs.ed.ac.uk>
##
## Developer use only, not part of distribution.
##
## $Id$
##
##  make buttons   make *.xpm from gimp xcf files
##  make webpix    make *.jpg from gimp xcf files
##  make install   copy *.jpg to ../html directory
##  make clean	   remove dummy targets
##  make cvsclean  remove non-cvs files
##
##  make dist	   ready for distribution
##		   (make buttons, move jpegs to html)
## 
###########################################################################

# Sources
BUTTONS=pg-goal.xcf pg-next.xcf pg-qed.xcf pg-restart.xcf pg-retract.xcf pg-undo.xcf pg-use.xcf pg-state.xcf pg-context.xcf pg-info.xcf pg-command.xcf pg-help.xcf pg-find.xcf pg-interrupt.xcf pg-goto.xcf pg-abort.xcf
WEBPIX=ProofGeneral.xcf pg-text.xcf

# Targets for html directory
WEBPIX_ONLY=
WEBPIX_TARGETS=$(WEBPIX_ONLY) ProofGeneral.jpg pg-text.gif
# Targets for doc directory
DOCPIX_TARGETS=ProofGeneral.jpg

# Junk not wanted
UNWANTED=text_general.jpg text_proof.jpg

CWD=$(shell pwd)
GIMP_DIRECTORY=$(CWD)/gimp

# Command to run gimp in batch mode.
GIMP=export GIMP_DIRECTORY=$(GIMP_DIRECTORY); gimp --no-interface --no-data  --console-messages --batch

default: all

images: all

all: buttons backgroundize-xpm webpix

dist:   all install distclean

# Edit xpm files to add a substitution background colour for
# the XEmacs toolbar background -- a hack that almost works
# (only almost because the images have anti-aliasing with
#  a different background colour, and xpm files only allow
#  one-bit alpha).
backgroundize-xpm: $(BUTTONS)
#	for f in *.xpm; do sed 's/c None.*"/c None s backgroundToolBarColor"/g' $$f > $$f.new; mv $$f.new $$f; done
	for f in *.xpm; do sed 's/c #E0E0E0.*"/c #E0E0E0 s backgroundToolBarColor"/g' $$f > $$f.new; mv $$f.new $$f; done

# NB: gimp sometimes fails with this argument, in case it is built
# without support for one of the image formats.
# (Happens with gimp from Mandrake 6.0, for example)
buttons: $(BUTTONS)
	$(GIMP) '(script-fu-proofgeneral-make-all-buttons 1)' '(gimp-quit 0)'
	$(MAKE) backgroundize-xpm
	touch buttons

webpix: $(WEBPIX)
	$(GIMP) '(script-fu-proofgeneral-save-all-pix 1)' '(gimp-quit 0)'
	touch webpix

cvsclean: clean
# For the time being we keep all this junk under CVS too, for convenience.
#	rm -f *.xpm *.jpg gimp/pluginrc
#	rm -f *.jpg gimp/pluginrc

# Remove all the generated targets and other junk.
wellclean: clean
	rm -f *.xpm *.jpg *.gif

distclean: clean

clean:
	rm -f buttons webpix gimp/pluginrc
	rm -f $(WEBPIX_ONLY) $(UNWANTED)

install: webpix
	cp -pf $(WEBPIX_TARGETS) ../html/images
	cp -pf $(DOCPIX_TARGETS) ../doc

##
## Batch mode is a bit broken on The Gimp at the moment (v 1.0)
## For script fu, at least, it seems tricky to pass arguments to
## scripts.
## With '1' as first argument to indicate "non-interactive", things
## don't work.  With '0', we get popup menus and args are ignored!

#%.xpm: %.xcf
#	$(GIMP) '(script-fu-proofgeneral-make-buttons "$(CWD)/$*")' '(gimp-quit 0)'

#%.jpg: %.xcf
#	$(GIMP) '(script-fu-proofgeneral-save-jpg 0 "$(CWD)/$*")' '(gimp-quit 0)'
#	cp -pf $*.jpg ../html


##
## Inkscape SVG sources
##
SVG:=$(shell ls *.svg 2>/dev/null)

INKS=$(SVG:.svg=.png) $(SVG:.svg=.xpm) 

inks:	${INKS} 

%.png:  %.svg
	inkscape --export-png $*.png $*.svg

%.xpm:  %.png
	convert -antialias -colors 256 $*.png $*.xpm