forked from opnsense/tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (76 loc) · 2.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
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
81
82
83
84
85
86
87
88
89
90
STEPS= base boot cdrom chroot clean core distfiles \
kernel nano plugins ports prefetch print rebase \
release serial sign skim test vga vm xtools
.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?= ${NAME:tl}
SUFFIX?= #-devel
FLAVOUR?= OpenSSL
SETTINGS?= 16.7
_ARCH!= uname -p
ARCH?= ${_ARCH}
DEVICE?= a10
SPEED?= 115200
UEFI?= yes
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}
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
cdrom vm serial vga nano: packages kernel
sets: distfiles packages kernel
images: cdrom nano serial vga vm
release: cdrom nano serial vga
# 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 "${VERBOSE}" != ""
VERBOSE_FLAGS= -x
.else
VERBOSE_HIDDEN= @
.endif
# Expand build steps to launch into the selected
# script with the proper build options set:
.for STEP in ${STEPS}
${STEP}: lint
${VERBOSE_HIDDEN} cd ${.CURDIR}/build && \
sh ${VERBOSE_FLAGS} ./${.TARGET}.sh -a ${ARCH} \
-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}" -d ${DEVICE} \
-m ${MIRRORS:Ox:[1]} -o "${STAGEDIRPREFIX}" -c ${SPEED} \
-u "${UEFI:tl}" -U "${SUFFIX}" ${${STEP}_ARGS}
.endfor