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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
# Beryl Makefile.
#
# (C) 2006 Quinn_Storm, Nigel Cunningham and others.
#
# Thanks to DBO for some good ideas.
#
# Targets:
#
# update: Run svn update.
# configure: Run autogen for each package.
# build: Build each package, installing what is needed for prerequisites.
# rebuild: Rerun building packages.
# usrlocalcheck: Check for binaries in /usr/local.
# debs: Build Debian packages, installing with sudo along the way.
# install: Install modules from source.
# uninstall: Remove modules previously installed from source.
# clean: Cleanup.
# distclean: Cleanup thoroughly.
# all: Build and install everything from source.
# all-debs: Build and install everything as debs.
# install-debug: Install debug versions of core and plugins.
#
# Per package targets:
# (Replace $NAME with one of the names from modules below).
#
# $NAME.clean Clean a single package.
# $NAME.newdeb (Re)build a deb.
# $NAME.build Build but don't install a single package.
# $NAME.rebuild (Re)build a package.
# $NAME.install Rebuild and install a single package from source.
# $NAME.uninstall Remove a package previously installed from source.
#
# The checked-out tree is copied to .$NAME.build for building, so any
# mistakes in cleaning up etc won't accidentally delete your precious files.
#
PREFIX?=/usr/local
SUCMD?=sudo
CFLAGS?=-O2 -Wall -ggdb3 -gstabs+
EXTRA_PACKAGE_ARGS=-us -uc
SVNVER:=$(shell svn info | head -5 | tail -1 | awk -F ': ' '{ print $$2 }')
TRUNKDIR:=$(shell pwd)
COOKIEDIR=cookies
.PRECIOUS: $(COOKIEDIR)/%.cfg $(COOKIEDIR)/%.built $(COOKIEDIR)/%.deb $(COOKIEDIR)/%.deb-installed $(COOKIEDIR)/%.installed
ifeq ($(QUIET),1)
REDIRECT=>>$(TRUNKDIR)/$*.log 2>&1
else
REDIRECT=2>&1 | tee -a $(TRUNKDIR)/$*.log
endif
modules:=\
beryl-core \
beryl-dbus \
beryl-plugins \
beryl-settings \
beryl-manager \
emerald \
emerald-themes \
heliodor
cfgmodules:=$(patsubst %,$(COOKIEDIR)/%.cfg,$(modules))
buildmodules:=$(patsubst %,$(COOKIEDIR)/%.built,$(modules))
installmodules:=$(patsubst %,$(COOKIEDIR)/%.installed,$(modules))
uninstallmodules:=$(patsubst %,$(COOKIEDIR)/%.uninstall,$(modules))
cleanmodules:=$(patsubst %,$(COOKIEDIR)/%.clean,$(modules))
debmodules:=$(patsubst %,$(COOKIEDIR)/%.deb,$(modules))
debinstalls:=$(patsubst %,$(COOKIEDIR)/%.deb-installed,$(modules))
all: update $(buildmodules)
all-debs: update debs
$(COOKIEDIR)/beryl-plugins.deb $(COOKIEDIR)/emerald.deb: $(COOKIEDIR)/beryl-core.deb-installed
$(COOKIEDIR)/beryl-settings.deb: $(COOKIEDIR)/beryl-plugins.deb-installed
$(COOKIEDIR)/beryl-plugins.built $(COOKIEDIR)/emerald.built: $(COOKIEDIR)/beryl-core.installed
beryl: update distclean $(COOKIEDIR)/beryl-core.build $(COOKIEDIR)/beryl-plugins.build
usrlocalcheck:
for i in beryl beryl-xgl beryl-settings beryl-manager \
beryl-settings-dump \
emerald emerald-theme-manager; do \
if [ -f /usr/local/bin/$$i ]; then \
echo "Found probably old $$i in /usr/local/bin/$$i"; \
echo " you should remove that, if you don't know exactly why it is there"; \
fi; \
done;
cookies:
mkdir cookies
update:
@svn up
@make distclean
$(COOKIEDIR)/%.clean:
@echo "==> Cleaning $* build."
@rm -rf .$*.build || /bin/true
@mkdir -p $(COOKIEDIR) || /bin/true
@rm -f $(COOKIEDIR)/$**
@touch $@
$(COOKIEDIR)/%.cfg: $(COOKIEDIR)/%.clean
@echo "==> Configuring $* build."
@rm -f $(COOKIEDIR)/$*.clean
@cp -ar $* .$*.build $(REDIRECT)
@sh -c 'cd .$*.build;./autogen.sh --prefix=$(PREFIX) CFLAGS="$(CFLAGS)"' $(REDIRECT)
@mkdir -p $(COOKIEDIR) || /bin/true
@touch $@
$(COOKIEDIR)/%.deb: $(COOKIEDIR)/%.cfg
@echo "==> Building $* debian package."
@if [ -d distro-specific-build-files/$*/debian ]; then \
cp -ar distro-specific-build-files/$*/debian .$*.build $(REDIRECT); \
fi
@sed "1 s/-svn[0-9]*)/)/" -i .$*.build/debian/changelog
@sed "1 s/)/-svn${SVNVER})/" -i .$*.build/debian/changelog
@rm -f $(COOKIEDIR)/$*.debdone || /bin/true
@sh -c 'cd .$*.build; dpkg-buildpackage -rfakeroot $(EXTRA_PACKAGE_ARGS) && touch ../$(COOKIEDIR)/$*.deb' $(REDIRECT);
@sed "1 s/-svn[0-9]*)/)/" -i .$*.build/debian/changelog
$(COOKIEDIR)/%.deb-installed: $(COOKIEDIR)/%.deb
@echo "==> Installing $* debian packages."
@$(SUCMD) dpkg -i *.deb $(REDIRECT)
@mkdir -p output/${SVNVER}
@mv -f *.deb *.changes *.tar.gz *.dsc *.log output/${SVNVER}
@touch $@
@touch $(COOKIEDIR)/$*.installed
$(COOKIEDIR)/%.newdeb: $(COOKIEDIR)/%.clean
@make $(COOKIEDIR)/$*.deb-installed
@/bin/true
$(COOKIEDIR)/%.built: $(COOKIEDIR)/%.cfg
@echo "==> Building $*."
@make -C .$*.build $(REDIRECT)
@touch $@
$(COOKIEDIR)/%.installed: $(COOKIEDIR)/%.built
@echo "==> Installing $*."
@$(SUCMD) make -C .$*.build install $(REDIRECT)
@touch $@
$(COOKIEDIR)/%.uninstall: $(COOKIEDIR)/%.cfg
@echo "==> Uninstalling $*."
@$(SUCMD) make -C .$*.build uninstall $(REDIRECT)
@rm -f $(COOKIEDIR)/$*.installed
%.clean: $(COOKIEDIR)/%.clean
@/bin/true
%.build: $(COOKIEDIR)/%.built
@/bin/true
%.rebuild: %.clean
make $(COOKIEDIR)/$*.built
%.install: $(COOKIEDIR)/%.build
@make $(COOKIEDIR)/$*.installed
%.uninstall: $(COOKIEDIR)/*.build
@make $(COOKIEDIR)/$*
%.deb: $(COOKIEDIR)/%.clean $(COOKIEDIR)/%.deb-installed
@/bin/true
%.newdeb: $(COOKIEDIR)/%.newdeb
@/bin/true
configure: $(cfgmodules)
configure-beryl: beryl-core.cfg beryl-plugins.cfg
install: $(installmodules)
uninstall: $(uninstallmodules)
clean: $(cleanmodules)
@/bin/true
build: $(buildmodules)
debs: $(debinstalls)
newdebs: distclean debs
distclean: clean
@rm -f *.changes *.deb *.tar.gz *.dsc
install-debug: $(COOKIEDIR)/beryl-core.deb $(COOKIEDIR)/beryl-plugins.deb
if [ -z "${PREFIX}" ] ; then PREFIX=/usr/local ; fi; \
sudo mkdir -p ${PREFIX}/bin; \
sudo mkdir -p ${PREFIX}/lib/beryl/backends; \
sudo cp .beryl-core.build/src/beryl-xgl ${PREFIX}/bin ; \
sudo cp .beryl-core.build/libberylsettings/.libs/libberylsettings.so ${PREFIX}/lib ; \
sudo cp .beryl-core.build/settings-backends/.libs/libini.so ${PREFIX}/lib/beryl/backends/ ; \
sudo cp .beryl-plugins.build/src/.libs/*.so ${PREFIX}/lib/beryl/ ; \
cfg-clean:
@rm -f $(COOKIEDIR)/*.cfg
|