~compiz-team/compiz-shelf-plugin/0.9.5

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Sam Spilsbury
  • Date: 2009-08-15 05:36:52 UTC
  • Revision ID: git-v1:dd11c33d03e1e0ead4d8654f591813219e8a3322
Initial C++ port. Window Shape restore and IPW adjustment are currently broken for reasons I cannot determine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
##
2
 
#
3
 
# Compiz plugin Makefile
4
 
#
5
 
# Copyright : (C) 2007 by Dennis Kasprzyk
6
 
# E-mail    : onestone@deltatauchi.de
7
 
#
8
 
#
9
 
# This program is free software; you can redistribute it and/or
10
 
# modify it under the terms of the GNU General Public License
11
 
# as published by the Free Software Foundation; either version 2
12
 
# of the License, or (at your option) any later version.
13
 
#
14
 
# This program is distributed in the hope that it will be useful,
15
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
# GNU General Public License for more details.
18
 
#
19
 
##
20
 
 
21
 
# plugin.info file contents
22
 
23
 
# PLUGIN = foo
24
 
# PKG_DEP = pango
25
 
# LDFLAGS_ADD = -lGLU
26
 
# CFLAGS_ADD = -I/usr/include/foo
27
 
# CHK_HEADERS = compiz-cube.h
28
 
#
29
 
 
30
 
#load config file
31
 
 
32
 
ECHO      = `which echo`
33
 
 
34
 
# default color settings
35
 
color := $(shell if [ $$TERM = "dumb" ]; then $(ECHO) "no"; else $(ECHO) "yes"; fi)
36
 
 
37
 
ifeq ($(shell if [ -f plugin.info ]; then $(ECHO) -n "found"; fi ),found)
38
 
include plugin.info
39
 
else
40
 
$(error $(shell if [ '$(color)' != 'no' ]; then \
41
 
                $(ECHO) -e "\033[1;31m[ERROR]\033[0m \"plugin.info\" file not found"; \
42
 
        else \
43
 
                $(ECHO) "[ERROR] \"plugin.info\" file not found"; \
44
 
        fi;))
45
 
endif
46
 
 
47
 
ifneq ($(shell if pkg-config --exists compiz; then $(ECHO) -n "found"; fi ),found)
48
 
$(error $(shell if [ '$(color)' != 'no' ]; then \
49
 
                $(ECHO) -e -n "\033[1;31m[ERROR]\033[0m Compiz not installed"; \
50
 
        else \
51
 
                $(ECHO) -n "[ERROR] Compiz not installed"; \
52
 
        fi))
53
 
endif
54
 
 
55
 
 
56
 
ifneq ($(shell if [ -n "$(PKG_DEP)" ]; then if pkg-config --exists $(PKG_DEP); then $(ECHO) -n "found"; fi; \
57
 
       else $(ECHO) -n "found"; fi ),found)
58
 
$(error $(shell if [ '$(color)' != 'no' ]; then \
59
 
                $(ECHO) -e -n "\033[1;31m[ERROR]\033[0m "; \
60
 
        else \
61
 
                $(ECHO) -n "[ERROR] "; \
62
 
        fi; \
63
 
        pkg-config --print-errors --short-errors --errors-to-stdout $(PKG_DEP); ))
64
 
endif
65
 
 
66
 
 
67
 
ifeq ($(BUILD_GLOBAL),true)
68
 
        PREFIX = $(shell pkg-config --variable=prefix compiz)
69
 
        CLIBDIR = $(shell pkg-config --variable=libdir compiz)
70
 
        CINCDIR = $(shell pkg-config --variable=includedir compiz)
71
 
        PKGDIR = $(CLIBDIR)/pkgconfig
72
 
        DESTDIR = $(shell pkg-config --variable=libdir compiz)/compiz
73
 
        XMLDIR = $(shell pkg-config --variable=prefix compiz)/share/compiz
74
 
        IMAGEDIR = $(shell pkg-config --variable=prefix compiz)/share/compiz
75
 
        DATADIR = $(shell pkg-config --variable=prefix compiz)/share/compiz
76
 
else
77
 
        DESTDIR = $(HOME)/.compiz/plugins
78
 
        XMLDIR = $(HOME)/.compiz/metadata
79
 
        IMAGEDIR = $(HOME)/.compiz/images
80
 
        DATADIR = $(HOME)/.compiz/data
81
 
endif
82
 
 
83
 
BUILDDIR = build
84
 
 
85
 
CC        = gcc
86
 
CPP       = g++
87
 
LIBTOOL   = libtool
88
 
INSTALL   = install
89
 
 
90
 
BCOP      = `pkg-config --variable=bin bcop`
91
 
 
92
 
CFLAGS    = -g -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing `pkg-config --cflags $(PKG_DEP) compiz ` $(CFLAGS_ADD)
93
 
LDFLAGS   = `pkg-config --libs $(PKG_DEP) compiz ` $(LDFLAGS_ADD)
94
 
 
95
 
DEFINES   = -DIMAGEDIR=\"$(IMAGEDIR)\" -DDATADIR=\"$(DATADIR)\"
96
 
 
97
 
POFILEDIR = $(shell if [ -n "$(PODIR)" ]; then $(ECHO) $(PODIR); else $(ECHO) ./po;fi )
98
 
 
99
 
COMPIZ_HEADERS = compiz.h compiz-core.h
100
 
COMPIZ_INC = $(shell pkg-config --variable=includedir compiz)/compiz/
101
 
 
102
 
is-bcop-target  := $(shell if [ -e $(PLUGIN).xml.in ]; then cat $(PLUGIN).xml.in | grep "useBcop=\"true\""; \
103
 
                     else if [ -e $(PLUGIN).xml ]; then cat $(PLUGIN).xml | grep "useBcop=\"true\""; fi; fi)
104
 
 
105
 
trans-target    := $(shell if [ -e $(PLUGIN).xml.in -o -e $(PLUGIN).xml ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN).xml;fi )
106
 
 
107
 
bcop-target     := $(shell if [ -n "$(is-bcop-target)" ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN).xml; fi )
108
 
bcop-target-src := $(shell if [ -n "$(is-bcop-target)" ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN)_options.c; fi )
109
 
bcop-target-hdr := $(shell if [ -n "$(is-bcop-target)" ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN)_options.h; fi )
110
 
 
111
 
gen-schemas     := $(shell if [ \( -e $(PLUGIN).xml.in -o -e $(PLUGIN).xml \) -a -n "`pkg-config --variable=xsltdir compiz-gconf`" ]; then $(ECHO) true; fi )
112
 
schema-target   := $(shell if [ -n "$(gen-schemas)" ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN).xml; fi )
113
 
schema-output   := $(shell if [ -n "$(gen-schemas)" ]; then $(ECHO) $(BUILDDIR)/compiz-$(PLUGIN).schema; fi )
114
 
 
115
 
ifeq ($(BUILD_GLOBAL),true)
116
 
    pkg-target         := $(shell if [ -e compiz-$(PLUGIN).pc.in -a -n "$(PREFIX)" -a -d "$(PREFIX)" ]; then $(ECHO) "$(BUILDDIR)/compiz-$(PLUGIN).pc"; fi )
117
 
    hdr-install-target := $(shell if [ -e compiz-$(PLUGIN).pc.in -a -n "$(PREFIX)" -a -d "$(PREFIX)" -a -e compiz-$(PLUGIN).h ]; then $(ECHO) "compiz-$(PLUGIN).h"; fi )
118
 
endif
119
 
 
120
 
# find all the object files
121
 
 
122
 
c-objs     := $(patsubst %.c,%.lo,$(shell find -name '*.c' 2> /dev/null | grep -v "$(BUILDDIR)/" | sed -e 's/^.\///'))
123
 
c-objs     += $(patsubst %.cpp,%.lo,$(shell find -name '*.cpp' 2> /dev/null | grep -v "$(BUILDDIR)/" | sed -e 's/^.\///'))
124
 
c-objs     += $(patsubst %.cxx,%.lo,$(shell find -name '*.cxx' 2> /dev/null | grep -v "$(BUILDDIR)/" | sed -e 's/^.\///'))
125
 
c-objs     := $(filter-out $(bcop-target-src:.c=.lo),$(c-objs))
126
 
 
127
 
h-files    := $(shell find -name '*.h' 2> /dev/null | grep -v "$(BUILDDIR)/" | sed -e 's/^.\///')
128
 
h-files    += $(bcop-target-hdr)
129
 
h-files    += $(foreach file,$(COMPIZ_HEADERS) $(CHK_HEADERS),$(shell $(ECHO) -n "$(COMPIZ_INC)$(file)"))
130
 
 
131
 
all-c-objs := $(addprefix $(BUILDDIR)/,$(c-objs)) 
132
 
all-c-objs += $(bcop-target-src:.c=.lo)
133
 
 
134
 
# additional files
135
 
 
136
 
data-files  := $(shell find data/  -name '*' -type f 2> /dev/null | sed -e 's/data\///')
137
 
image-files := $(shell find images/ -name '*' -type f 2> /dev/null | sed -e 's/images\///')
138
 
 
139
 
# system include path parameter, -isystem doesn't work on old gcc's
140
 
inc-path-param = $(shell if [ -z "`gcc --version | head -n 1 | grep ' 3'`" ]; then $(ECHO) "-isystem"; else $(ECHO) "-I"; fi)
141
 
 
142
 
# Tests
143
 
ifeq ($(shell if [ -n "$(is-bcop-target)" -a -z "$(BCOP)" ]; then $(ECHO) -n "error"; fi ),error)
144
 
$(error $(shell if [ '$(color)' != 'no' ]; then \
145
 
                $(ECHO) -e -n "\033[1;31m[ERROR]\033[0m BCOP not installed but is needed to build plugin"; \
146
 
        else \
147
 
                $(ECHO) -n "[ERROR] BCOP not installed but is needed to build plugin"; \
148
 
        fi))
149
 
endif
150
 
 
151
 
ifeq ($(shell if [ "x$(BUILD_GLOBAL)" != "xtrue" -a -e compiz-$(PLUGIN).pc.in ]; then $(ECHO) -n "warn"; fi ),warn)
152
 
$(warning $(shell if [ '$(color)' != 'no' ]; then \
153
 
                $(ECHO) -e -n "\033[1;31m[WARNING]\033[0m This plugin might be needed by other plugins. Install it with \"BUILD_GLOBAL=true sudo make install\" "; \
154
 
        else \
155
 
                $(ECHO) -n "[WARNING]  This plugin might be needed by other plugins. Install it with \"BUILD_GLOBAL=true sudo make install\""; \
156
 
        fi))
157
 
endif
158
 
 
159
 
#
160
 
# Do it.
161
 
#
162
 
 
163
 
.PHONY: $(BUILDDIR) build-dir trans-target bcop-build pkg-creation schema-creation c-build-objs c-link-plugin
164
 
 
165
 
all: $(BUILDDIR) build-dir trans-target bcop-build pkg-creation schema-creation c-build-objs c-link-plugin
166
 
 
167
 
trans-build: $(trans-target)
168
 
 
169
 
bcop-build:   $(bcop-target-hdr) $(bcop-target-src)
170
 
 
171
 
schema-creation: $(schema-output)
172
 
 
173
 
c-build-objs: $(all-c-objs)
174
 
 
175
 
c-link-plugin: $(BUILDDIR)/lib$(PLUGIN).la
176
 
 
177
 
pkg-creation: $(pkg-target)
178
 
 
179
 
#
180
 
# Create build directory
181
 
#
182
 
 
183
 
$(BUILDDIR) :
184
 
        @mkdir -p $(BUILDDIR)
185
 
 
186
 
$(DESTDIR) :
187
 
        @mkdir -p $(DESTDIR)
188
 
 
189
 
#
190
 
# fallback if xml.in doesn't exists
191
 
#
192
 
$(BUILDDIR)/%.xml: %.xml
193
 
        @cp $< $@
194
 
 
195
 
#
196
 
# Translating
197
 
#
198
 
$(BUILDDIR)/%.xml: %.xml.in
199
 
        @if [ -d $(POFILEDIR) ]; then \
200
 
                if [ '$(color)' != 'no' ]; then \
201
 
                        $(ECHO) -e -n "\033[0;1;5mtranslate \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
202
 
                else \
203
 
                        $(ECHO) "translate $<  ->  $@"; \
204
 
                fi; \
205
 
                intltool-merge -x -u $(POFILEDIR) $< $@ > /dev/null; \
206
 
                if [ '$(color)' != 'no' ]; then \
207
 
                        $(ECHO) -e "\r\033[0mtranslate : \033[34m$< -> $@\033[0m"; \
208
 
                fi; \
209
 
        else \
210
 
                if [ '$(color)' != 'no' ]; then \
211
 
                        $(ECHO) -e -n "\033[0;1;5mconvert   \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
212
 
                else \
213
 
                        $(ECHO) "convert   $<  ->  $@"; \
214
 
                fi; \
215
 
                cat $< | sed -e 's;<_;<;g' -e 's;</_;</;g' > $@; \
216
 
                if [ '$(color)' != 'no' ]; then \
217
 
                        $(ECHO) -e "\r\033[0mconvert   : \033[34m$< -> $@\033[0m"; \
218
 
                fi; \
219
 
        fi
220
 
 
221
 
#
222
 
# BCOP'ing
223
 
 
224
 
$(BUILDDIR)/%_options.h: $(BUILDDIR)/%.xml
225
 
        @if [ '$(color)' != 'no' ]; then \
226
 
                $(ECHO) -e -n "\033[0;1;5mbcop'ing  \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
227
 
        else \
228
 
                $(ECHO) "bcop'ing  $<  ->  $@"; \
229
 
        fi
230
 
        @$(BCOP) --header=$@ $<
231
 
        @if [ '$(color)' != 'no' ]; then \
232
 
                $(ECHO) -e "\r\033[0mbcop'ing  : \033[34m$< -> $@\033[0m"; \
233
 
        fi
234
 
 
235
 
$(BUILDDIR)/%_options.c: $(BUILDDIR)/%.xml
236
 
        @if [ '$(color)' != 'no' ]; then \
237
 
                $(ECHO) -e -n "\033[0;1;5mbcop'ing  \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
238
 
        else \
239
 
                $(ECHO) "bcop'ing  $<  ->  $@"; \
240
 
        fi
241
 
        @$(BCOP) --source=$@ $< 
242
 
        @if [ '$(color)' != 'no' ]; then \
243
 
                $(ECHO) -e "\r\033[0mbcop'ing  : \033[34m$< -> $@\033[0m"; \
244
 
        fi
245
 
 
246
 
#
247
 
# Schema generation
248
 
 
249
 
$(BUILDDIR)/compiz-%.schema: $(BUILDDIR)/%.xml
250
 
        @if [ '$(color)' != 'no' ]; then \
251
 
                $(ECHO) -e -n "\033[0;1;5mschema'ing\033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
252
 
        else \
253
 
                $(ECHO) "schema'ing  $<  ->  $@"; \
254
 
        fi
255
 
        @xsltproc `pkg-config --variable=xsltdir compiz-gconf`/schemas.xslt $< > $@
256
 
        @if [ '$(color)' != 'no' ]; then \
257
 
                $(ECHO) -e "\r\033[0mschema    : \033[34m$< -> $@\033[0m"; \
258
 
        fi
259
 
 
260
 
#
261
 
# pkg config file generation
262
 
 
263
 
$(BUILDDIR)/compiz-%.pc: compiz-%.pc.in
264
 
        @if [ '$(color)' != 'no' ]; then \
265
 
                $(ECHO) -e -n "\033[0;1;5mpkgconfig \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
266
 
        else \
267
 
                $(ECHO) "pkgconfig   $<  ->  $@"; \
268
 
        fi
269
 
        @COMPIZREQUIRES=`cat $(PKGDIR)/compiz.pc | grep Requires | sed -e 's;Requires: ;;g'`; \
270
 
    COMPIZCFLAGS=`cat $(PKGDIR)/compiz.pc | grep Cflags | sed -e 's;Cflags: ;;g'`; \
271
 
    sed -e 's;@prefix@;$(PREFIX);g' -e 's;\@libdir@;$(CLIBDIR);g' \
272
 
        -e 's;@includedir@;$(CINCDIR);g' -e 's;\@VERSION@;0.0.1;g' \
273
 
        -e "s;@COMPIZ_REQUIRES@;$$COMPIZREQUIRES;g" \
274
 
        -e "s;@COMPIZ_CFLAGS@;$$COMPIZCFLAGS;g" $< > $@;
275
 
        @if [ '$(color)' != 'no' ]; then \
276
 
                $(ECHO) -e "\r\033[0mpkgconfig : \033[34m$< -> $@\033[0m"; \
277
 
        fi
278
 
 
279
 
#
280
 
# Compiling
281
 
#
282
 
 
283
 
$(BUILDDIR)/%.lo: %.c $(h-files)
284
 
        @if [ '$(color)' != 'no' ]; then \
285
 
                $(ECHO) -n -e "\033[0;1;5mcompiling \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
286
 
        else \
287
 
                $(ECHO) "compiling $< -> $@"; \
288
 
        fi
289
 
        @$(LIBTOOL) --quiet --mode=compile $(CC) $(CFLAGS) $(DEFINES) -I$(BUILDDIR) -c -o $@ $<
290
 
        @if [ '$(color)' != 'no' ]; then \
291
 
                $(ECHO) -e "\r\033[0mcompiling : \033[34m$< -> $@\033[0m"; \
292
 
        fi
293
 
 
294
 
$(BUILDDIR)/%.lo: $(BUILDDIR)/%.c $(h-files)
295
 
        @if [ '$(color)' != 'no' ]; then \
296
 
                $(ECHO) -n -e "\033[0;1;5mcompiling \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
297
 
        else \
298
 
                $(ECHO) "compiling $< -> $@"; \
299
 
        fi
300
 
        @$(LIBTOOL) --quiet --mode=compile $(CC) $(CFLAGS) $(DEFINES) -I$(BUILDDIR) -c -o $@ $<
301
 
        @if [ '$(color)' != 'no' ]; then \
302
 
                $(ECHO) -e "\r\033[0mcompiling : \033[34m$< -> $@\033[0m"; \
303
 
        fi
304
 
 
305
 
$(BUILDDIR)/%.lo: %.cpp $(h-files)
306
 
        @if [ '$(color)' != 'no' ]; then \
307
 
                $(ECHO) -n -e "\033[0;1;5mcompiling \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
308
 
        else \
309
 
                $(ECHO) "compiling $< -> $@"; \
310
 
        fi
311
 
        @$(LIBTOOL) --quiet --mode=compile $(CPP) $(CFLAGS) $(DEFINES) -I$(BUILDDIR) -c -o $@ $<
312
 
        @if [ '$(color)' != 'no' ]; then \
313
 
                $(ECHO) -e "\r\033[0mcompiling : \033[34m$< -> $@\033[0m"; \
314
 
        fi
315
 
 
316
 
$(BUILDDIR)/%.lo: %.cxx $(h-files)
317
 
        @if [ '$(color)' != 'no' ]; then \
318
 
                $(ECHO) -n -e "\033[0;1;5mcompiling \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \
319
 
        else \
320
 
                $(ECHO) "compiling $< -> $@"; \
321
 
        fi
322
 
        @$(LIBTOOL) --quiet --mode=compile $(CPP) $(CFLAGS) $(DEFINES) -I$(BUILDDIR) -c -o $@ $<
323
 
        @if [ '$(color)' != 'no' ]; then \
324
 
                $(ECHO) -e "\r\033[0mcompiling : \033[34m$< -> $@\033[0m"; \
325
 
        fi
326
 
 
327
 
#
328
 
# Linking
329
 
#
330
 
 
331
 
cxx-rpath-prefix := -Wl,-rpath,
332
 
 
333
 
$(BUILDDIR)/lib$(PLUGIN).la: $(all-c-objs)
334
 
        @if [ '$(color)' != 'no' ]; then \
335
 
                $(ECHO) -e -n "\033[0;1;5mlinking   \033[0m: \033[0;31m$@\033[0m"; \
336
 
        else \
337
 
                $(ECHO) "linking   : $@"; \
338
 
        fi
339
 
        @$(LIBTOOL) --quiet --mode=link $(CC) $(LDFLAGS) -rpath $(DESTDIR) -o $@ $(all-c-objs)
340
 
        @if [ '$(color)' != 'no' ]; then \
341
 
                $(ECHO) -e "\r\033[0mlinking   : \033[34m$@\033[0m"; \
342
 
        fi
343
 
 
344
 
 
345
 
clean:
346
 
        @if [ '$(color)' != 'no' ]; then \
347
 
                $(ECHO) -e -n "\033[0;1;5mremoving  \033[0m: \033[0;31m./$(BUILDDIR)\033[0m"; \
348
 
        else \
349
 
                $(ECHO) "removing  : ./$(BUILDDIR)"; \
350
 
        fi
351
 
        @rm -rf $(BUILDDIR)
352
 
        @if [ '$(color)' != 'no' ]; then \
353
 
                $(ECHO) -e "\r\033[0mremoving  : \033[34m./$(BUILDDIR)\033[0m"; \
354
 
        fi
355
 
        
356
 
 
357
 
install: $(DESTDIR) all
358
 
        @if [ '$(color)' != 'no' ]; then \
359
 
            $(ECHO) -n -e "\033[0;1;5minstall   \033[0m: \033[0;31m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \
360
 
        else \
361
 
            $(ECHO) "install   : $(DESTDIR)/lib$(PLUGIN).so"; \
362
 
        fi
363
 
        @mkdir -p $(DESTDIR)
364
 
        @$(INSTALL) $(BUILDDIR)/.libs/lib$(PLUGIN).so $(DESTDIR)/lib$(PLUGIN).so
365
 
        @if [ '$(color)' != 'no' ]; then \
366
 
            $(ECHO) -e "\r\033[0minstall   : \033[34m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \
367
 
        fi
368
 
        @if [ -e $(BUILDDIR)/$(PLUGIN).xml ]; then \
369
 
            if [ '$(color)' != 'no' ]; then \
370
 
                $(ECHO) -n -e "\033[0;1;5minstall   \033[0m: \033[0;31m$(XMLDIR)/$(PLUGIN).xml\033[0m"; \
371
 
            else \
372
 
                $(ECHO) "install   : $(XMLDIR)/$(PLUGIN).xml"; \
373
 
            fi; \
374
 
            mkdir -p $(XMLDIR); \
375
 
            $(INSTALL)  $(BUILDDIR)/$(PLUGIN).xml $(XMLDIR)/$(PLUGIN).xml; \
376
 
            if [ '$(color)' != 'no' ]; then \
377
 
                $(ECHO) -e "\r\033[0minstall   : \033[34m$(XMLDIR)/$(PLUGIN).xml\033[0m"; \
378
 
            fi; \
379
 
        fi
380
 
        @if [ -n "$(hdr-install-target)" ]; then \
381
 
            if [ '$(color)' != 'no' ]; then \
382
 
                $(ECHO) -n -e "\033[0;1;5minstall   \033[0m: \033[0;31m$(CINCDIR)/compiz/$(hdr-install-target)\033[0m"; \
383
 
            else \
384
 
                $(ECHO) "install   : $(CINCDIR)/compiz/$(hdr-install-target)"; \
385
 
            fi; \
386
 
            $(INSTALL) --mode=u=rw,go=r,a-s $(hdr-install-target) $(CINCDIR)/compiz/$(hdr-install-target); \
387
 
            if [ '$(color)' != 'no' ]; then \
388
 
                $(ECHO) -e "\r\033[0minstall   : \033[34m$(CINCDIR)/compiz/$(hdr-install-target)\033[0m"; \
389
 
            fi; \
390
 
        fi
391
 
        @if [ -n "$(pkg-target)" ]; then \
392
 
            if [ '$(color)' != 'no' ]; then \
393
 
                $(ECHO) -n -e "\033[0;1;5minstall   \033[0m: \033[0;31m$(PKGDIR)/compiz-$(PLUGIN).pc\033[0m"; \
394
 
            else \
395
 
                $(ECHO) "install   : $(PKGDIR)/compiz-$(PLUGIN).pc"; \
396
 
            fi; \
397
 
            $(INSTALL) --mode=u=rw,go=r,a-s $(pkg-target) $(PKGDIR)/compiz-$(PLUGIN).pc; \
398
 
            if [ '$(color)' != 'no' ]; then \
399
 
                $(ECHO) -e "\r\033[0minstall   : \033[34m$(PKGDIR)/compiz-$(PLUGIN).pc\033[0m"; \
400
 
            fi; \
401
 
        fi
402
 
        @if [ -n "$(schema-output)" -a -e "$(schema-output)" ]; then \
403
 
            if [ '$(color)' != 'no' ]; then \
404
 
                $(ECHO) -n -e "\033[0;1;5minstall   \033[0m: \033[0;31m$(schema-output)\033[0m"; \
405
 
            else \
406
 
                $(ECHO) "install   : $(schema-output)"; \
407
 
            fi; \
408
 
            if [ "x$(USER)" = "xroot" ]; then \
409
 
                GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
410
 
                gconftool-2 --makefile-install-rule $(schema-output) > /dev/null; \
411
 
            else \
412
 
                gconftool-2 --install-schema-file=$(schema-output) > /dev/null; \
413
 
            fi; \
414
 
            if [ '$(color)' != 'no' ]; then \
415
 
                $(ECHO) -e "\r\033[0minstall   : \033[34m$(schema-output)\033[0m"; \
416
 
            fi; \
417
 
        fi
418
 
        @if [ -n "$(data-files)" ]; then \
419
 
            mkdir -p $(DATADIR); \
420
 
            for FILE in $(data-files); do \
421
 
                if [ '$(color)' != 'no' ]; then \
422
 
                    $(ECHO) -n -e "\033[0;1;5minstall   \033[0m: \033[0;31m$(DATADIR)/$$FILE\033[0m"; \
423
 
                else \
424
 
                    $(ECHO) "install   : $(DATADIR)/$$FILE"; \
425
 
                fi; \
426
 
                FILEDIR="$(DATADIR)/`dirname "$$FILE"`"; \
427
 
                mkdir -p "$$FILEDIR"; \
428
 
                $(INSTALL) --mode=u=rw,go=r,a-s data/$$FILE $(DATADIR)/$$FILE; \
429
 
                if [ '$(color)' != 'no' ]; then \
430
 
                    $(ECHO) -e "\r\033[0minstall   : \033[34m$(DATADIR)/$$FILE\033[0m"; \
431
 
                fi; \
432
 
            done \
433
 
        fi
434
 
        @if [ -n "$(image-files)" ]; then \
435
 
            mkdir -p $(IMAGEDIR); \
436
 
            for FILE in $(image-files); do \
437
 
                if [ '$(color)' != 'no' ]; then \
438
 
                    $(ECHO) -n -e "\033[0;1;5minstall   \033[0m: \033[0;31m$(IMAGEDIR)/$$FILE\033[0m"; \
439
 
                else \
440
 
                    $(ECHO) "install   : $(IMAGEDIR)/$$FILE"; \
441
 
                fi; \
442
 
                FILEDIR="$(IMAGEDIR)/`dirname "$$FILE"`"; \
443
 
                mkdir -p "$$FILEDIR"; \
444
 
                $(INSTALL) --mode=u=rw,go=r,a-s images/$$FILE $(IMAGEDIR)/$$FILE; \
445
 
                if [ '$(color)' != 'no' ]; then \
446
 
                    $(ECHO) -e "\r\033[0minstall   : \033[34m$(IMAGEDIR)/$$FILE\033[0m"; \
447
 
                fi; \
448
 
            done \
449
 
        fi
450
 
 
451
 
uninstall:      
452
 
        @if [ -e $(DESTDIR)/lib$(PLUGIN).so ]; then \
453
 
            if [ '$(color)' != 'no' ]; then \
454
 
                $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \
455
 
            else \
456
 
                $(ECHO) "uninstall : $(DESTDIR)/lib$(PLUGIN).so"; \
457
 
            fi; \
458
 
            rm -f $(DESTDIR)/lib$(PLUGIN).so; \
459
 
            if [ '$(color)' != 'no' ]; then \
460
 
                $(ECHO) -e "\r\033[0muninstall : \033[34m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \
461
 
            fi; \
462
 
        fi
463
 
        @if [ -e $(XMLDIR)/$(PLUGIN).xml ]; then \
464
 
            if [ '$(color)' != 'no' ]; then \
465
 
                $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(XMLDIR)/$(PLUGIN).xml\033[0m"; \
466
 
            else \
467
 
                $(ECHO) "uninstall : $(XMLDIR)/$(PLUGIN).xml"; \
468
 
            fi; \
469
 
            rm -f $(XMLDIR)/$(PLUGIN).xml; \
470
 
            if [ '$(color)' != 'no' ]; then \
471
 
                $(ECHO) -e "\r\033[0muninstall : \033[34m$(XMLDIR)/$(PLUGIN).xml\033[0m"; \
472
 
            fi; \
473
 
        fi
474
 
        @if [ -n "$(hdr-install-target)" -a -e $(CINCDIR)/compiz/$(hdr-install-target) ]; then \
475
 
            if [ '$(color)' != 'no' ]; then \
476
 
                $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(CINCDIR)/compiz/$(hdr-install-target)\033[0m"; \
477
 
            else \
478
 
                $(ECHO) "uninstall : $(CINCDIR)/compiz/$(hdr-install-target)"; \
479
 
            fi; \
480
 
            rm -f $(CINCDIR)/compiz/$(hdr-install-target); \
481
 
            if [ '$(color)' != 'no' ]; then \
482
 
                $(ECHO) -e "\r\033[0muninstall : \033[34m$(CINCDIR)/compiz/$(hdr-install-target)\033[0m"; \
483
 
            fi; \
484
 
        fi
485
 
        @if [ -n "$(pkg-target)" -a -e $(PKGDIR)/compiz-$(PLUGIN).pc ]; then \
486
 
            if [ '$(color)' != 'no' ]; then \
487
 
                $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(PKGDIR)/compiz-$(PLUGIN).pc\033[0m"; \
488
 
            else \
489
 
                $(ECHO) "uninstall : $(PKGDIR)/compiz-$(PLUGIN).pc"; \
490
 
            fi; \
491
 
            rm -f $(PKGDIR)/compiz-$(PLUGIN).pc; \
492
 
            if [ '$(color)' != 'no' ]; then \
493
 
                $(ECHO) -e "\r\033[0muninstall : \033[34m$(PKGDIR)/compiz-$(PLUGIN).pc\033[0m"; \
494
 
            fi; \
495
 
        fi
496
 
        @if [ -n "$(schema-output)" -a -e "$(schema-output)" -a 'x$(USER)' = 'xroot' ]; then \
497
 
            if [ '$(color)' != 'no' ]; then \
498
 
                $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(schema-output)\033[0m"; \
499
 
            else \
500
 
                $(ECHO) "uninstall : $(schema-output)"; \
501
 
            fi; \
502
 
            GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
503
 
            gconftool-2 --makefile-uninstall-rule $(schema-output) > /dev/null; \
504
 
            if [ '$(color)' != 'no' ]; then \
505
 
                $(ECHO) -e "\r\033[0muninstall : \033[34m$(schema-output)\033[0m"; \
506
 
            fi; \
507
 
        fi
508
 
        @if [ -n "$(data-files)" ]; then \
509
 
            for FILE in $(data-files); do \
510
 
                if [ '$(color)' != 'no' ]; then \
511
 
                    $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(DATADIR)/$$FILE\033[0m"; \
512
 
                else \
513
 
                    $(ECHO) "uninstall : $(DATADIR)/$$FILE"; \
514
 
                fi; \
515
 
                rm -f $(DATADIR)/$$FILE; \
516
 
                if [ '$(color)' != 'no' ]; then \
517
 
                    $(ECHO) -e "\r\033[0muninstall : \033[34m$(DATADIR)/$$FILE\033[0m"; \
518
 
                fi; \
519
 
            done \
520
 
        fi
521
 
        @if [ -n "$(image-files)" ]; then \
522
 
            for FILE in $(image-files); do \
523
 
                if [ '$(color)' != 'no' ]; then \
524
 
                    $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(IMAGEDIR)/$$FILE\033[0m"; \
525
 
                else \
526
 
                    $(ECHO) "uninstall : $(IMAGEDIR)/$$FILE"; \
527
 
                fi; \
528
 
                rm -f $(IMAGEDIR)/$$FILE; \
529
 
                if [ '$(color)' != 'no' ]; then \
530
 
                    $(ECHO) -e "\r\033[0muninstall : \033[34m$(IMAGEDIR)/$$FILE\033[0m"; \
531
 
                fi; \
532
 
            done \
533
 
        fi