File: Makefile

package info (click to toggle)
ukopp 4.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 996 kB
  • ctags: 901
  • sloc: cpp: 10,893; makefile: 65
file content (72 lines) | stat: -rw-r--r-- 1,990 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
# ukopp makefile 

PROGRAM = ukopp
VERSION = 4.9
SOURCE = $(PROGRAM)-$(VERSION).cc

# defaults for parameters that may be pre-defined
CXXFLAGS ?= -O2 -Wall -ggdb 
LDFLAGS ?= -rdynamic -lpthread
PREFIX ?= /usr

# target install directories
BINDIR = $(PREFIX)/bin
SHAREDIR = $(PREFIX)/share/$(PROGRAM)
DATADIR = $(SHAREDIR)/data
ICONDIR = $(SHAREDIR)/icons
DOCDIR = $(PREFIX)/share/doc/$(PROGRAM)
MANDIR = $(PREFIX)/share/man/man1
MENUFILE = $(PREFIX)/share/applications/$(PROGRAM).desktop

CFLAGS = $(CXXFLAGS) -c `pkg-config --cflags gtk+-3.0`
LIBS = `pkg-config --libs gtk+-3.0` -lpthread

$(PROGRAM): $(PROGRAM).o zfuncs.o
	$(CXX) $(LDFLAGS) $(PROGRAM).o zfuncs.o $(LIBS) -o $(PROGRAM)

$(PROGRAM).o: $(SOURCE)
	$(CXX) $(CFLAGS) -o $(PROGRAM).o $(SOURCE)

zfuncs.o: zfuncs.cc zfuncs.h
	$(CXX) $(CFLAGS) zfuncs.cc \
          -D PREFIX=\"$(PREFIX)\" -D DOCDIR=\"$(DOCDIR)\" 

install: $(PROGRAM)
	rm -f  $(DESTDIR)$(BINDIR)/$(PROGRAM)
	rm -f -R  $(DESTDIR)$(SHAREDIR)
	rm -f -R  $(DESTDIR)$(DOCDIR)
	rm -f  $(DESTDIR)$(MANDIR)/$(PROGRAM).1.gz
	rm -f  $(DESTDIR)$(MENUFILE)
	mkdir -p  $(DESTDIR)$(BINDIR)
	mkdir -p  $(DESTDIR)$(DATADIR)
	mkdir -p  $(DESTDIR)$(ICONDIR)
	mkdir -p  $(DESTDIR)$(DOCDIR)
	mkdir -p  $(DESTDIR)$(MANDIR)
	mkdir -p  $(DESTDIR)$(PREFIX)/share/applications
	cp -f  $(PROGRAM) $(DESTDIR)$(BINDIR)
	cp -f -R  data/* $(DESTDIR)$(DATADIR)
	cp -f -R  icons/* $(DESTDIR)$(ICONDIR)
	cp -f -R  doc/* $(DESTDIR)$(DOCDIR)
	gzip -f -9 $(DESTDIR)$(DOCDIR)/changelog
	# man page
	cp -f doc/$(PROGRAM).man $(PROGRAM).1
	gzip -f -9 $(PROGRAM).1
	cp $(PROGRAM).1.gz $(DESTDIR)$(MANDIR)
	rm -f $(PROGRAM).1.gz
	# menu (desktop) file
	cp -f desktop $(DESTDIR)$(MENUFILE)
	chmod +x $(DESTDIR)$(MENUFILE)

uninstall:
	rm -f  $(DESTDIR)$(BINDIR)/$(PROGRAM)
	rm -f -R  $(DESTDIR)$(SHAREDIR)
	rm -f -R  $(DESTDIR)$(DOCDIR)
	rm -f  $(DESTDIR)$(MANDIR)/$(PROGRAM).1.gz
	xdg-desktop-menu uninstall $(DESTDIR)$(MENUFILE)
	rm -f  $(DESTDIR)$(MENUFILE)

clean: 
	rm -f  $(PROGRAM)
	rm -f  *.o