File: Makefile.in

package info (click to toggle)
spnavcfg 1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 272 kB
  • sloc: cpp: 666; sh: 126; ansic: 96; makefile: 64
file content (75 lines) | stat: -rw-r--r-- 1,804 bytes parent folder | download
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
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 ?= $(qtuic)
MOC ?= $(qtmoc)
RCC ?= $(qtrcc)

warn = -pedantic -Wall
incpath = -I. -I$(PREFIX)/include
libpath = -L$(PREFIX)/lib

CFLAGS = $(warn) $(dbg) $(opt) $(incpath) -fPIC $(add_cflags) -MMD
CXXFLAGS = $(warn) $(dbg) $(opt) $(incpath) -fPIC $(cflags_qt) \
		 $(add_cflags) -MMD
LDFLAGS = $(libpath) $(libs_qt) -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