forked from FreeSpacenav/spnavcfg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
52 lines (42 loc) · 1.4 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
obj = spnavcfg.o front_gtk.o back.o cfgfile.o
dep = $(obj:.o=.d)
bin = spnavcfg
warn = -Wall
CC = gcc
SED = sed
INSTALL = install
CFLAGS = -pedantic $(warn) $(dbg) $(opt) `pkg-config --cflags gtk+-2.0 gmodule-export-2.0`
LDFLAGS = `pkg-config --libs gtk+-2.0 gmodule-export-2.0` -lX11
$(bin): $(obj)
$(CC) -o $@ $(obj) $(LDFLAGS)
-include $(dep)
%.o: $(srcdir)/%.c | $(srcdir)/ui.h
$(CC) $(CFLAGS) -c $< -o $@
$(CPP) $(CFLAGS) $< -MM -MT $@ >$(@:.o=.d)
$(srcdir)/ui.h: $(srcdir)/ui/ui.xml
echo 'static const char *ui_xml =' >$@
$(SED) 's/"/\\"/g; s/^.*$$/ "&\\n"/' $< >>$@
echo ';' >>$@
.PHONY: clean
clean:
rm -f $(obj) $(bin) $(srcdir)/ui.h
.PHONY: install
install:
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 4775 $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
mkdir -p $(DESTDIR)$(PREFIX)/share/pixmaps
cp icons/spnavcfg-*.png $(DESTDIR)$(PREFIX)/share/pixmaps/
for i in 48 128 256; do \
destdir=$(DESTDIR)$(PREFIX)/share/icons/hicolor/$${i}x$${i}/apps; \
mkdir -p $$destdir; \
rm -f $$destdir/spnavcfg-$${i}x$${i}.png; \
ln -s $(DESTDIR)$(PREFIX)/share/pixmaps/spnavcfg-$${i}x$${i}.png $$destdir/spnavcfg-$${i}x$${i}.png; \
done
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/spnavcfg-*.png
for i in 48 128 256; do \
destdir=$(DESTDIR)$(PREFIX)/share/icons/hicolor/$${i}x$${i}/apps; \
rm -f $${destdir}/spnavcfg-$${i}x$${i}.png; \
done