about summary refs log tree commit diff
path: root/Makefile
blob: 275d6acdb4f062917c4393e7cc115115cb5f0e62 (plain) (blame)
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
PREFIX ?= /usr/local
SHAREDIR ?= ${PREFIX}/share
MANDIR ?= ${SHAREDIR}/man
EXMANDIR ?= ${SHAREDIR}/exman

SYSTEMS += FreeBSD
SYSTEMS += Linux
SYSTEMS += NetBSD
SYSTEMS += OpenBSD
SYSTEMS += POSIX

all: exman
.for system in ${SYSTEMS}
	${MAKE} -C ${system} ${.TARGET}
.endfor

.SUFFIXES: .in

.in:
	sed 's|%%EXMANDIR%%|${EXMANDIR}|g' ${.IMPSRC} > ${.TARGET}
	chmod a+x ${.TARGET}

clean:
	rm -f exman
.for system in ${SYSTEMS}
	${MAKE} -C ${system} ${.TARGET}
.endfor

install: exman exman.1
	install -d ${PREFIX}/bin ${MANDIR}/man1
	install exman ${PREFIX}/bin
	install -m 644 exman.1 ${MANDIR}/man1
.for system in ${SYSTEMS}
	${MAKE} -C ${system} ${.TARGET}
.endfor

uninstall:
	rm -f ${PREFIX}/bin/exman ${MANDIR}/man1/exman.1
.for system in ${SYSTEMS}
	${MAKE} -C ${system} ${.TARGET}
.endfor