-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.in
107 lines (81 loc) · 2.27 KB
/
Makefile.in
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
export PREFIX
export CFLAGS_cfg
export LDFLAGS_cfg
name = xlivebg
src = $(wildcard src/*.c)
obj = $(src:.c=.o)
bin = $(name)
incdir = -Isrc -Iinclude -Ilibs/imago/src -Ilibs/treestore/src -I/usr/local/include \
-I/usr/X11R6/include
libdir = -Llibs/imago -Llibs/treestore -L/usr/local/lib -L/usr/X11R6/lib
CFLAGS = -std=gnu89 -pedantic -Wall $(dbg) $(opt) -DPREFIX=\"$(PREFIX)\" \
$(CFLAGS_cfg) $(CFLAGS_xrandr) $(CFLAGS_alloca) $(incdir)
LDFLAGS = $(libdir) $(LDFLAGS_cfg) $(LDFLAGS_xrandr) -lX11 -lXext -lGL \
$(libdl) -limago -ltreestore -lpng -ljpeg -lz
.PHONY: all
all: $(bin) plugins $(gui_target)
# download test image
bgimage.jpg:
wget http://nuclear.mutantstargoat.com/sw/xlivebg/tmp/bgimage.jpg
$(bin): $(obj) libs
$(CC) -o $@ $(obj) $(LDFLAGS)
.PHONY: clean
clean:
rm -f $(obj) $(bin)
.PHONY: clean-all
clean-all: clean clean-libs clean-plugins clean-gui
.PHONY: install
install: $(bin)
mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/share/$(name)
cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
cp include/xlivebg.h $(DESTDIR)$(PREFIX)/include/xlivebg.h
cd $(DESTDIR)$(PREFIX)/bin && rm -f $(bin)-cmd && ln -s $(bin) $(bin)-cmd
# cp data/* $(DESTDIR)$(PREFIX)/share/$(name)/
.PHONY: install-all
install-all: install install-plugins install-gui
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)
rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)-cmd
rm -f $(DESTDIR)$(PREFIX)/include/xlivebg.h
# rm -f $(DESTDIR)$(PREFIX)/share/$(name)/*
# rmdir $(DESTDIR)$(PREFIX)/share/$(name) || true
.PHONY: uninstall-all
uninstall-all: uninstall uninstall-plugins uninstall-gui
# ---- plugins rules ----
.PHONY: plugins
plugins:
$(MAKE) -C plugins
.PHONY: clean-plugins
clean-plugins:
$(MAKE) -C plugins clean
.PHONY: install-plugins
install-plugins:
$(MAKE) -C plugins install
.PHONY: uninstall-plugins
uninstall-plugins:
$(MAKE) -C plugins uninstall
# ---- libs rules ----
.PHONY: libs
libs:
$(MAKE) -C libs
.PHONY: clean-libs
clean-libs:
$(MAKE) -C libs clean
# ---- GUI rules ----
.PHONY: gui
gui:
$(MAKE) -C gui
.PHONY: clean-gui
clean-gui:
$(MAKE) -C gui clean
.PHONY: install-gui
install-gui:
$(MAKE) -C gui install
.PHONY: uninstall-gui
uninstall-gui:
$(MAKE) -C gui uninstall
# ---- documentation rules ----
.PHONY: doc
doc:
$(MAKE) -C doc