summaryrefslogtreecommitdiffstats
path: root/ubuntu/maverick/defaultsettings/desktop-base/usplash/moreblue-orbit/Makefile
blob: 6f677f506bbbe1c04004aea6b0a91a2e79a6f856 (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
118
119
120
# usplash-theme-debian - Makefile
#
# Copyright © 2006 - 2007 David Härdeman <david@hardeman.nu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

# This is the list of sizes to build and include in the theme
# By convention, the sizes should go from smaller to larger
sizes = 640x480 800x600 1024x768 1280x1024

# This creates a list with entries like background_800x600.png...
backgrounds = $(addsuffix .png, $(addprefix background_, $(sizes)))
background_objs = $(backgrounds:.png=.o)
progressfgs = $(addsuffix .png, $(addprefix progressfg_, $(sizes)))
progressfg_objs = $(progressfgs:.png=.o)
progressbgs = $(addsuffix .png, $(addprefix progressbg_, $(sizes)))
progressbg_objs = $(progressbgs:.png=.o)
theme = moreblue-orbit-theme.so

CC       = gcc
CFLAGS   = -g -Wall -fPIC
LDFLAGS  =
INCLUDES =
COMPILE  = $(CC) $(INCLUDES) $(CFLAGS)
LINK     = $(CC) $(CFLAGS) $(LDFLAGS)

INSTALL      = install
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_PROG = $(INSTALL) -m 755

DESTDIR = /usr/lib/usplash

# Default = silent build
V =
ifeq ($(strip $(V)),)
E = @echo
Q = @
else
E = @\#
Q =
endif
export E Q

all: $(theme)
.PHONY: all
.DEFAULT: all

$(theme): theme.o $(background_objs) $(progressfg_objs) $(progressbg_objs)
	$(E) "  LINK    " $@
	$(Q) $(COMPILE) -shared -o $@ $^

theme.h: theme.in progress.png themesetup.sh $(backgrounds) $(progressfgs) $(progressbgs)
	$(E) "  THMPARM " $@
	$(Q) ./themesetup.sh $(sizes) > $@

theme.o: theme.c theme.h

background_%.png: background.svg cmap.gif
	$(E) "  BG      " $@
	$(Q) rsvg-convert -w `echo $* | cut -dx -f1` -h `echo $* | cut -dx -f2` -f png $< > $@

progressfg_%.png: background_%.png progress.png cmap.gif
	$(E) "  PROGFG  " $@
	$(Q) composite -compose dst_over -gravity center $< progress.png $@

progressbg_%.png: background_%.png progress.png cmap.gif
	$(E) "  PROGBG  " $@
	$(Q) composite -gravity center -dissolve 25x100 progress.png $< png:- | \
	     composite -gravity center -compose src_over png:- progress.png $@

%.o: %.c
	$(E) "  CC      " $@
	$(Q) $(COMPILE) -o $@ -c $<

%.c: %.png cmap.gif
	$(E) "  PNGSRC  " $@
	$(Q) convert $< +dither -map cmap.gif gif:- | \
	     convert gif:- $<
	$(Q) pngtousplash $< > $@

#cmap.gif: background.svg progress.png
#	$(E) "  CMAP    " $@
#	$(Q) rsvg-convert -w 1024 -h 768 -f png background.svg | \
#	     composite -compose src_over -gravity center progress.png png:- +dither cmap.gif

install: $(theme)
	$(E) "  INSTALL " $<
	$(Q) $(INSTALL_DATA) -D $< $(DESTDIR)/$(theme)
.PHONY: install

install-strip: $(theme)
	$(MAKE) INSTALL='$(INSTALL) -s' install
.PHONY: install-strip

clean:
	$(E) "  CLEAN   "
	$(Q) - find . -type f -name '*.png.c' -print0 | xargs -0r rm -f
	$(Q) - find . -type f -name '*.cfont' -print0 | xargs -0r rm -f
	$(Q) - find . -type f -name '*.o' -print0     | xargs -0r rm -f
	$(Q) - find . -type f -name '*.so' -print0    | xargs -0r rm -f
#	$(Q) - find . -type f -name 'cmap.*' -print0   | xargs -0r rm -f
	$(Q) - find . -type f -name 'background_*' -print0   | xargs -0r rm -f
	$(Q) - find . -type f -name 'progressfg_*' -print0   | xargs -0r rm -f
	$(Q) - find . -type f -name 'progressbg_*' -print0   | xargs -0r rm -f
	$(Q) - rm -f theme.h
.PHONY: clean

.PRECIOUS: %.c progressbg_%.png progressfg_%.png background_%.png