forked from FreeSpacenav/spnavcfg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
76 lines (60 loc) · 1.83 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
csrc = $(wildcard src/*.c)
ccsrc = $(wildcard src/*.cc)
mochdr = src/ui.h
mocsrc = $(mochdr:.h=.moc.cc)
obj = $(sort $(csrc:.c=.o) $(ccsrc:.cc=.o) $(mocsrc:.cc=.o)) res.cc
dep = $(csrc:.c=.d) $(ccsrc:.cc=.d)
bin = spnavcfg
CC ?= gcc
CXX ?= g++
UIC ?= uic
MOC ?= moc
RCC ?= rcc
warn = -pedantic -Wall
incpath = -I. -I$(PREFIX)/include
libpath = -L$(PREFIX)/lib
CFLAGS = $(warn) $(dbg) $(opt) $(incpath) -fPIC $(add_cflags) -MMD
CXXFLAGS = -std=c++11 $(warn) $(dbg) $(opt) $(incpath) -fPIC `pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets` \
$(add_cflags) -MMD
LDFLAGS = $(libpath) `pkg-config --libs Qt5Core Qt5Gui Qt5Widgets` -lspnav -lX11 \
$(add_ldflags)
$(bin): $(obj)
$(CXX) -o $@ $(obj) $(LDFLAGS)
-include $(dep)
src/main.o: src/main.cc
src/ui.o: src/ui.cc ui_mainwin.h ui_bnmaprow.h ui_about.h
ui_mainwin.h: ui/spnavcfg.ui
$(UIC) -o $@ $<
ui_bnmaprow.h: ui/bnmaprow.ui
$(UIC) -o $@ $<
ui_about.h: ui/about.ui
$(UIC) -o $@ $<
%.moc.cc: %.h
$(MOC) -o $@ $(incpath) $<
res.cc: ui/spnavcfg.qrc icons/devices.png
$(RCC) -o $@ $<
.PHONY: clean
clean:
rm -f $(obj) $(bin) $(mocsrc) ui_mainwin.h ui_bnmaprow.h ui_about.h res.cc
.PHONY: cleandep
cleandep:
rm -f $(dep)
.PHONY: install
install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
for i in 48 128 256; do \
destdir=$(DESTDIR)$(PREFIX)/share/icons/hicolor/$${i}x$${i}/apps; \
mkdir -p $$destdir; \
cp icons/spnavcfg-$${i}x$${i}.png $$destdir/spnavcfg.png; \
done
mkdir -p $(DESTDIR)$(PREFIX)/share/applications
cp -a icons/spnavcfg.desktop $(DESTDIR)$(PREFIX)/share/applications/
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)
for i in 48 128 256; do \
destdir=$(DESTDIR)$(PREFIX)/share/icons/hicolor/$${i}x$${i}/apps; \
rm -f $${destdir}/spnavcfg.png; \
done
rm -f $(DESTDIR)$(PREFIX)/share/applications/spnavcfg.desktop