You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

163 lines
5.1 KiB

  1. # Copyright (c) 2015-2020 Franco Fichtner <franco@opnsense.org>
  2. #
  3. # Redistribution and use in source and binary forms, with or without
  4. # modification, are permitted provided that the following conditions
  5. # are met:
  6. #
  7. # 1. Redistributions of source code must retain the above copyright
  8. # notice, this list of conditions and the following disclaimer.
  9. #
  10. # 2. Redistributions in binary form must reproduce the above copyright
  11. # notice, this list of conditions and the following disclaimer in the
  12. # documentation and/or other materials provided with the distribution.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  15. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  17. # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  18. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  20. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  21. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  22. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  23. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  24. # SUCH DAMAGE.
  25. STEPS= arm base boot chroot clean compress confirm core distfiles \
  26. download dvd fingerprint info kernel nano packages plugins \
  27. ports prefetch print rebase release rename rewind serial sign \
  28. skim test update upload verify vga vm xtools
  29. SCRIPTS= batch hotfix nightly
  30. .PHONY: ${STEPS} ${SCRIPTS}
  31. PAGER?= less
  32. .MAKE.JOB.PREFIX?= # tampers with some of our make invokes
  33. all:
  34. @cat ${.CURDIR}/README.md | ${PAGER}
  35. lint-steps:
  36. .for STEP in common ${STEPS}
  37. @sh -n ${.CURDIR}/build/${STEP}.sh
  38. .endfor
  39. lint-composite:
  40. .for SCRIPT in ${SCRIPTS}
  41. @sh -n ${.CURDIR}/composite/${SCRIPT}.sh
  42. .endfor
  43. lint: lint-steps lint-composite
  44. # Special vars to load early build.conf settings:
  45. TOOLSDIR?= /usr/tools
  46. TOOLSBRANCH?= master
  47. SETTINGS?= 20.7
  48. CONFIG?= ${TOOLSDIR}/config/${SETTINGS}/build.conf
  49. .-include "${CONFIG}"
  50. # Bootstrap the build options if not set:
  51. NAME?= OPNsense
  52. TYPE?= ${NAME:tl}
  53. SUFFIX?= #-devel
  54. FLAVOUR?= OpenSSL LibreSSL # first one is default
  55. _ARCH!= uname -p
  56. ARCH?= ${_ARCH}
  57. KERNEL?= SMP
  58. ADDITIONS?= os-dyndns${SUFFIX}
  59. DEVICE?= A10
  60. SPEED?= 115200
  61. UEFI?= yes
  62. GITBASE?= https://github.com/opnsense
  63. MIRRORS?= https://opnsense.c0urier.net \
  64. http://mirrors.nycbug.org/pub/opnsense \
  65. http://mirror.wdc1.us.leaseweb.net/opnsense \
  66. http://mirror.sfo12.us.leaseweb.net/opnsense \
  67. http://mirror.fra10.de.leaseweb.net/opnsense \
  68. http://mirror.ams1.nl.leaseweb.net/opnsense
  69. SERVER?= user@does.not.exist
  70. UPLOADDIR?= .
  71. _VERSION!= date '+%Y%m%d%H%M'
  72. VERSION?= ${_VERSION}
  73. STAGEDIRPREFIX?=/usr/obj
  74. PORTSREFURL?= https://git-01.md.hardenedbsd.org/HardenedBSD/hardenedbsd-ports.git
  75. PORTSREFDIR?= /usr/hardenedbsd-ports
  76. PORTSREFBRANCH?=master
  77. PLUGINSENV?= PLUGIN_PHP=${PHP} PLUGIN_ABI=${SETTINGS} PLUGIN_PYTHON=${PYTHON}
  78. PLUGINSDIR?= /usr/plugins
  79. PLUGINSBRANCH?= stable/${SETTINGS}
  80. PORTSDIR?= /usr/ports
  81. PORTSBRANCH?= master
  82. COREDIR?= /usr/core
  83. COREBRANCH?= stable/${SETTINGS}
  84. COREENV?= CORE_PHP=${PHP} CORE_ABI=${SETTINGS} CORE_PYTHON=${PYTHON}
  85. SRCDIR?= /usr/src
  86. SRCBRANCH?= stable/${SETTINGS}
  87. # for plugins and core
  88. DEVELBRANCH?= #master
  89. # A couple of meta-targets for easy use and ordering:
  90. ports distfiles: base
  91. plugins: ports
  92. core: plugins
  93. packages test: core
  94. dvd nano serial vga vm: packages kernel
  95. sets: distfiles packages kernel
  96. images: dvd nano serial vga vm # arm
  97. release: dvd nano serial vga
  98. # Expand target arguments for the script append:
  99. .for TARGET in ${.TARGETS}
  100. _TARGET= ${TARGET:C/\-.*//}
  101. .if ${_TARGET} != ${TARGET}
  102. ${_TARGET}_ARGS+= ${TARGET:C/^[^\-]*(\-|\$)//:S/,/ /g}
  103. ${TARGET}: ${_TARGET}
  104. .endif
  105. .endfor
  106. .if "${VERBOSE}" != ""
  107. VERBOSE_FLAGS= -x
  108. .else
  109. VERBOSE_HIDDEN= @
  110. .endif
  111. .for _VERSION in PERL PHP PYTHON RUBY
  112. VERSIONS+= PRODUCT_${_VERSION}=${${_VERSION}}
  113. .endfor
  114. # Expand build steps to launch into the selected
  115. # script with the proper build options set:
  116. .for STEP in ${STEPS}
  117. ${STEP}: lint-steps
  118. ${VERBOSE_HIDDEN} cd ${.CURDIR}/build && \
  119. sh ${VERBOSE_FLAGS} ./${.TARGET}.sh -a ${ARCH} -F ${KERNEL} \
  120. -f "${FLAVOUR}" -n ${NAME} -v ${VERSION} -s ${SETTINGS} \
  121. -S ${SRCDIR} -P ${PORTSDIR} -p ${PLUGINSDIR} -T ${TOOLSDIR} \
  122. -C ${COREDIR} -R ${PORTSREFDIR} -t ${TYPE} -k "${PRIVKEY}" \
  123. -K "${PUBKEY}" -l "${SIGNCHK}" -L "${SIGNCMD}" -d ${DEVICE} \
  124. -m ${MIRRORS:Ox:[1]} -o "${STAGEDIRPREFIX}" -c ${SPEED} \
  125. -b ${SRCBRANCH} -B ${PORTSBRANCH} -e ${PLUGINSBRANCH} \
  126. -g ${TOOLSBRANCH} -E ${COREBRANCH} -G ${PORTSREFBRANCH} \
  127. -H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" \
  128. -V "${ADDITIONS}" -O "${GITBASE}" -r "${SERVER}" \
  129. -q "${VERSIONS}" -h "${PLUGINSENV}" -I "${UPLOADDIR}" \
  130. -D "${DEVELBRANCH}" -A "${PORTSREFURL}" ${${STEP}_ARGS}
  131. .endfor
  132. .for SCRIPT in ${SCRIPTS}
  133. ${SCRIPT}: lint-composite
  134. ${VERBOSE_HIDDEN} cd ${.CURDIR} && FLAVOUR="${FLAVOUR}" \
  135. sh ${VERBOSE_FLAGS} ./composite/${SCRIPT}.sh ${${SCRIPT}_ARGS}
  136. .endfor