forked from opnsense/tools
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
80 lines (66 loc) · 1.95 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
77
78
79
80
STEPS= base chroot clean core distfiles kernel iso \
memstick nano plugins ports prefetch rebase \
regress release skim
.PHONY: ${STEPS}
PAGER?= less
all:
@cat ${.CURDIR}/README.md | ${PAGER}
lint:
. for STEP in ${STEPS}
@sh -n ${.CURDIR}/build/${STEP}.sh
. endfor
# Load the custom options from a file:
.if defined(CONFIG)
.include "${CONFIG}"
.endif
# Bootstrap the build options if not set:
NAME?= OPNsense
TYPE?= opnsense
FLAVOUR?= OpenSSL
SETTINGS?= 16.1
MIRRORS?= https://opnsense.c0urier.net \
http://mirrors.nycbug.org/pub/opnsense \
http://mirror.wdc1.us.leaseweb.net/opnsense \
http://mirror.sfo12.us.leaseweb.net/opnsense \
http://mirror.fra10.de.leaseweb.net/opnsense \
http://mirror.ams1.nl.leaseweb.net/opnsense
_VERSION!= date '+%Y%m%d%H%M'
VERSION?= ${_VERSION}
PRIVKEY?= /root/repo.key
PUBKEY?= /root/repo.pub
STAGEDIRPREFIX?=/usr/obj
PORTSREFDIR?= /usr/freebsd-ports
PLUGINSDIR?= /usr/plugins
TOOLSDIR?= /usr/tools
PORTSDIR?= /usr/ports
COREDIR?= /usr/core
SRCDIR?= /usr/src
# A couple of meta-targets for easy use and ordering:
ports distfiles: base
plugins: ports
core: plugins
packages: core
iso memstick nano: packages kernel
everything release: iso memstick nano
# Expand target arguments for the script append:
.for TARGET in ${.TARGETS}
_TARGET= ${TARGET:C/\-.*//}
.if ${_TARGET} != ${TARGET}
${_TARGET}_ARGS+= ${TARGET:C/^[^\-]*(\-|\$)//:S/,/ /g}
${TARGET}: ${_TARGET}
.endif
.endfor
.if defined(VERBOSE)
VERBOSE_FLAGS= -x
.endif
# Expand build steps to launch into the selected
# script with the proper build options set:
.for STEP in ${STEPS}
${STEP}: lint
@cd ${.CURDIR}/build && sh ${VERBOSE_FLAGS} ./${.TARGET}.sh \
-f ${FLAVOUR} -n ${NAME} -v ${VERSION} -s ${SETTINGS} \
-S ${SRCDIR} -P ${PORTSDIR} -p ${PLUGINSDIR} -T ${TOOLSDIR} \
-C ${COREDIR} -R ${PORTSREFDIR} -t ${TYPE} -k ${PRIVKEY} \
-K ${PUBKEY} -l "${SIGNCHK}" -L "${SIGNCMD}" \
-m ${MIRRORS:Ox:[1]} -o "${STAGEDIRPREFIX}" ${${STEP}_ARGS}
.endfor