-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
49 lines (34 loc) · 1.21 KB
/
makefile
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
prefix ?= /usr/local
all: nbudstee
VERSION_STRING := $(shell cat version 2>/dev/null || git describe --tags --always --dirty=-m 2>/dev/null || date "+%F %T %z" 2>/dev/null)
ifdef VERSION_STRING
CVFLAGS := -DVERSION_STRING='"${VERSION_STRING}"'
endif
CXXFLAGS ?= -Wall -Wextra -Wno-unused-parameter -O3 -g
LDFLAGS ?=
CPPFLAGS += -D_FILE_OFFSET_BITS=64
CXXFLAGS += -std=c++11
nbudstee: nbudstee.cpp
g++ nbudstee.cpp $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(CVFLAGS) $(AFLAGS) -o nbudstee $(LOADLIBES) $(LDLIBS)
.PHONY: all install uninstall clean dumpversion
dumpversion:
@echo $(VERSION_STRING)
clean:
rm -f nbudstee nbudstee.1
install: nbudstee
install -D -m 755 nbudstee $(DESTDIR)$(prefix)/bin/nbudstee
uninstall:
rm -f $(DESTDIR)$(prefix)/bin/nbudstee $(DESTDIR)$(prefix)/share/man/man1/nbudstee.1
HELP2MANOK := $(shell help2man --version 2>/dev/null)
ifdef HELP2MANOK
all: nbudstee.1
nbudstee.1: nbudstee
help2man -s 1 -N ./nbudstee -n "Non-Blocking Unix Domain Socket Tee" -o nbudstee.1
install: install-man
.PHONY: install-man
install-man: nbudstee.1
install -D -m 644 nbudstee.1 $(DESTDIR)$(prefix)/share/man/man1/nbudstee.1
-mandb -pq
else
$(shell echo "Install help2man for man page generation" >&2)
endif