forked from apotheon/porttools
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
76 lines (62 loc) · 2.05 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
# FreeBSD Port Tools
#
# Makefile
#
# Package name and version
PORTNAME?= porttools
PORTVERSION?= 1.08
DISTNAME?= ${PORTNAME}-${PORTVERSION}
VERSIONSTRING= ${PORTVERSION}
PROGRAM= scripts/port
SCRIPTS= scripts/cmd_commit scripts/cmd_create scripts/cmd_diff \
scripts/cmd_fetch \
scripts/cmd_help scripts/cmd_install scripts/cmd_submit \
scripts/cmd_test scripts/cmd_upgrade scripts/util_diff
IN_FILES= ${SCRIPTS} ${PROGRAM}
INC_HEADER= scripts/inc_header
DOCS= LICENSE NEWS README.md THANKS
TEMPLATES= tmpl
MAN1= man/port.1
MAN5= man/porttools.5
# Normally provided via bsd.port.mk infrastructure
PREFIX?= ${HOME}/pkg
DATADIR?= ${PREFIX}/share/${PORTNAME}
DOCSDIR?= ${PREFIX}/share/doc/${PORTNAME}
TMPLDIR= ${PREFIX}/share/${PORTNAME}/tmpl
MANPREFIX?= ${PREFIX}
BSD_INSTALL_SCRIPT?= install -m 555
BSD_INSTALL_DATA?= install -m 444
BSD_INSTALL_MAN?= install -m 444
# Targets
all: ${IN_FILES}
#This is run explicitly from port makefile due to i386 "issues"
${INC_HEADER}: ${INC_HEADER}.in
@echo "Creating header include file..."
@cp scripts/inc_header.in scripts/inc_header
@sed -e 's/^/# /' LICENSE >> scripts/inc_header
.SUFFIXES: .in
.in: ${INC_HEADER}
@echo "Creating ${.TARGET}..."
@sed -e 's%__VERSION__%${VERSIONSTRING}%;s,__PREFIX__,${PREFIX},' \
${INC_HEADER} ${.IMPSRC} > ${.TARGET}
@chmod a+x ${.TARGET}
install: ${IN_FILES}
mkdir -p ${DESTDIR}${PREFIX}/bin
${BSD_INSTALL_SCRIPT} ${PROGRAM} ${DESTDIR}${PREFIX}/bin
mkdir -p ${DESTDIR}${DATADIR}
${BSD_INSTALL_SCRIPT} ${SCRIPTS} ${DESTDIR}${DATADIR}
mkdir -p ${DESTDIR}${MANPREFIX}/man/man1
${BSD_INSTALL_MAN} ${MAN1} ${DESTDIR}${MANPREFIX}/man/man1
mkdir -p ${DESTDIR}${MANPREFIX}/man/man5
${BSD_INSTALL_MAN} ${MAN5} ${DESTDIR}${MANPREFIX}/man/man5
mkdir -p ${DESTDIR}${TMPLDIR}
cd ${TEMPLATES} && find . | \
cpio -pdm ${DESTDIR}${TMPLDIR}
install-docs:
mkdir -p ${DESTDIR}${DOCSDIR}
${BSD_INSTALL_DATA} ${DOCS} ${DESTDIR}${DOCSDIR}
clean:
rm -rf ${PROGRAM} ${SCRIPTS} scripts/inc_header
TODO: .todo Makefile
devtodo --filter -done,+children --TODO
.PHONY: all install install-docs clean TODO