summaryrefslogtreecommitdiff
path: root/Makefile
blob: 0f8eb368f8904b15ce6b3306efcc1c5225e1bdcf (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

ifeq ($(BUILD_GLOBAL),true)
	DESTDIR = `pkg-config --variable=libdir compiz`/compiz
	XMLDIR = `pkg-config --variable=prefix compiz`/share/compiz
else
	DESTDIR = $(HOME)/.compiz/plugins
	METADATADIR = $(HOME)/.compiz/metadata
endif

XSLTDIR = `pkg-config --variable=xsltdir compiz-gconf`

PLUGIN  = flash

CC      = gcc
LIBTOOL = libtool
INSTALL = install

CFLAGS  = -Wall -g `pkg-config --cflags compiz cairo` -shared
LDFLAGS = `pkg-config --libs compiz cairo`

%.lo: %.c
	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<

%.la: $(PLUGIN).lo
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -rpath $(DESTDIR) -o $@ $<

all: lib$(PLUGIN).la

install: lib$(PLUGIN).la
	@mkdir -p $(DESTDIR)
	$(LIBTOOL) --mode=install $(INSTALL) lib$(PLUGIN).la \
	$(DESTDIR)/lib$(PLUGIN).la
	@mkdir -p $(METADATADIR)
	@cp $(PLUGIN).xml $(METADATADIR)

install-schema:
	@xsltproc -o $(PLUGIN).schema $(XSLTDIR)/schemas.xslt $(PLUGIN).xml
	@gconftool-2 --install-schema-file=$(PLUGIN).schema

clean:
	rm -rf *.lo *.o lib$(PLUGIN).* .libs *~ $(PLUGIN).schema