-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (63 loc) · 1.8 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
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
ROOT = .
include ${ROOT}/config.mk
################################################################################
## Build.
.PHONY: all
all: app doc
.PHONY: app
app:
${MAKE} -C ${srcdir}
.PHONY: doc
doc:
${MAKE} -C ${docsrcdir}
.PHONY: debug
debug:
CFLAGS+="-g3 -O0 -DDEBUG=9" ${MAKE}
.PHONY: test
test:
${MAKE} -C ${testdir}
.PHONY: clean
clean:
${MAKE} -C ${srcdir} clean
${MAKE} -C ${docsrcdir} clean
${MAKE} -C ${testdir} clean
################################################################################
## Install / Uninstall.
INSTALL ?= install
INSTALL_DATA ?= ${INSTALL} -m644
INSTALL_DIR ?= ${INSTALL} -d
prefix ?= /usr/local
exec_prefix ?= ${prefix}
datarootdir ?= ${prefix}/share
bindir ?= ${exec_prefix}/bin
datadir ?= ${datarootdir}
docdir ?= ${datarootdir}/doc
includedir ?= ${prefix}/include
infodir ?= ${datarootdir}/info
libdir ?= ${exec_prefix}/lib
libexecdir ?= ${exec_prefix}/libexecdir
licensedir ?= ${datarootdir}/licenses
localedir ?= ${datarootdir}/locale
localstatedir ?= ${prefix}/var
mandir ?= ${datarootdir}/man
runstatedir ?= ${prefix}/run
sbindir ?= ${exec_prefix}/sbin
sharedstatedir ?= ${prefix}/com
sysconfdir ?= ${perfix}/etc
.PHONY: install
install:
${MAKE}
${INSTALL_DIR} ${DESTDIR}${bindir}
${INSTALL} ${srcdir}/${cmdname} ${DESTDIR}${bindir}/${cmdname}
${INSTALL_DIR} ${DESTDIR}${mandir}/man1
${INSTALL_DATA} ${docsrcdir}/${cmdname}.1 ${DESTDIR}${mandir}/man1/${cmdname}.1
${INSTALL_DIR} ${DESTDIR}${licensedir}/${cmdname}
${INSTALL_DATA} LICENSE ${DESTDIR}${licensedir}/${cmdname}/LICENSE
.PHONY: uninstall
uninstall:
-rm -f ${DESTDIR}${bindir}/${cmdname}
-rmdir -p ${DESTDIR}${bindir}
-rm -f ${DESTDIR}${mandir}/${cmdname}.${mansection}.gz
-rmdir -p ${DESTDIR}${mandir}
-rm -f ${DESTDIR}${licensedir}/${cmdname}/LICENSE
-rmdir -p ${DESTDIR}${licensedir}/${cmdname}