mirror of
https://github.com/truenas/core-build.git
synced 2026-02-15 07:36:18 +00:00
91
Makefile
91
Makefile
@@ -1,89 +1,102 @@
|
||||
#-
|
||||
# Copyright 2010-2015 iXsystems, Inc.
|
||||
# Copyright 2010-2016 The FreeNAS Project
|
||||
# All rights reserved
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted providing that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
# This Software is Provided by the Author ''As Is'' and Any Express or
|
||||
# Implied Warranties, Including, but not Limited to, the Implied
|
||||
# Warranties of Merchantability and Fitness for a Particular Purpose
|
||||
# are Disclaimed. In no Event Shall the Author be Liable for any
|
||||
# Direct, Indirect, Incidental, Special, Exemplary, or Consequential
|
||||
# Damages (Including, but not Limited to, Procurement of Substitute
|
||||
# Goods or Services; Loss of Use, Data, or Profits; or Business
|
||||
# Interruption) However Caused and on any Theory of Liability, Whether
|
||||
# in Contract, Strict Liability, or Tort (Including Negligence or
|
||||
# Otherwise) Arising in any way out of the use of This Software, Even
|
||||
# if Advised of the Possibility of Such Damage.
|
||||
#
|
||||
#####################################################################
|
||||
######################################################################
|
||||
|
||||
BUILD_TIMESTAMP != date -u '+%Y%m%d%H%M'
|
||||
BUILD_TIMESTAMP != date -u '+%Y%m%d%H%M'
|
||||
BUILD_STARTED != date '+%s'
|
||||
|
||||
BUILD_ROOT ?= ${.CURDIR}
|
||||
BUILD_CONFIG := ${BUILD_ROOT}/build/config
|
||||
BUILD_TOOLS := ${BUILD_ROOT}/build/tools
|
||||
PYTHONPATH := ${BUILD_ROOT}/build/lib
|
||||
BE_ROOT := ${BUILD_ROOT}/_BE
|
||||
OBJDIR := ${BE_ROOT}/objs
|
||||
PROFILE ?= default
|
||||
GIT_REPO_SETTING = ${BUILD_ROOT}/.git-repo-setting
|
||||
PROFILE_SETTING = ${BUILD_ROOT}/.profile-setting
|
||||
MK := ${MAKE} -f ${BUILD_ROOT}/Makefile.inc1
|
||||
DOC_PATH := ${BUILD_ROOT}/_BE/freenas-docs
|
||||
API_PATH := ${BUILD_ROOT}/_BE/freenas/docs
|
||||
|
||||
PROFILE_SETTING = ${BUILD_ROOT}/build/profiles/profile-setting
|
||||
PROFILE != cat ${PROFILE_SETTING}
|
||||
|
||||
GIT_REPO_SETTING = ${BUILD_ROOT}/.git-repo-setting
|
||||
.if exists(${GIT_REPO_SETTING})
|
||||
GIT_LOCATION != cat ${GIT_REPO_SETTING}
|
||||
.endif
|
||||
|
||||
BE_ROOT := ${BUILD_ROOT}/_BE
|
||||
OBJDIR := ${BE_ROOT}/objs
|
||||
DOC_PATH := ${BE_ROOT}/freenas-docs
|
||||
API_PATH := ${BE_ROOT}/freenas/docs
|
||||
|
||||
.if exists(${BUILD_ROOT}/.git-ref-path)
|
||||
GIT_REF_PATH != cat ${BUILD_ROOT}/.git-ref-path
|
||||
.elif exists(/build/gitrefs)
|
||||
GIT_REF_PATH ?= /build/gitrefs
|
||||
.endif
|
||||
|
||||
.if exists(${PROFILE_SETTING})
|
||||
PROFILE != cat ${PROFILE_SETTING}
|
||||
.endif
|
||||
|
||||
.export MK
|
||||
.export GIT_LOCATION
|
||||
.export BUILD_TIMESTAMP
|
||||
.export BUILD_STARTED
|
||||
|
||||
.export BUILD_ROOT
|
||||
.export BUILD_CONFIG
|
||||
.export BUILD_TOOLS
|
||||
.export BUILD_LOGLEVEL
|
||||
.export PYTHONPATH
|
||||
.export MK
|
||||
|
||||
.export PROFILE
|
||||
|
||||
.export GIT_REPO_SETTING
|
||||
.export GIT_LOCATION
|
||||
|
||||
.export BE_ROOT
|
||||
.export OBJDIR
|
||||
.export BUILD_STARTED
|
||||
.export GIT_REPO_SETTING
|
||||
.export GIT_REF_PATH
|
||||
.export PROFILE
|
||||
.export API_PATH
|
||||
.export DOC_PATH
|
||||
.export API_PATH
|
||||
|
||||
.export GIT_REF_PATH
|
||||
|
||||
.export BUILD_LOGLEVEL
|
||||
|
||||
.BEGIN:
|
||||
# make(.Target) is a conditional that evalutes to true iff the .TARGET
|
||||
# was specified on the command line or has been delcared the default
|
||||
# .Target (either explicitly or implicity) some where before this line
|
||||
.if !make(remote) && !make(sync) && !make(bootstrap-pkgs)
|
||||
@echo "[0:00:00] ==> NOTICE: Selected profile: ${PROFILE}"
|
||||
@echo "[0:00:00] ==> NOTICE: Build timestamp: ${BUILD_TIMESTAMP}"
|
||||
.endif
|
||||
|
||||
.if !make(remote) && !make(sync) && !make(bootstrap-pkgs)
|
||||
@${BUILD_TOOLS}/buildenv.py ${BUILD_TOOLS}/check-host.py
|
||||
.if !make(checkout) && !make(update) && !make(clean) && !make(cleandist) && !make(profiles) && !make(select-profile) && !make(docs) && !make(api-docs)
|
||||
@${BUILD_TOOLS}/buildenv.py ${BUILD_TOOLS}/check-sandbox.py
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# The following section is where the Recipes and other items that are
|
||||
# to be built are denoted regardless of dependency states. This is to
|
||||
# say that if the .Target is "release" the release files will be built
|
||||
# (re-built) regardless of whether they have have been changed or not.
|
||||
.PHONY: release ports tests
|
||||
|
||||
buildenv:
|
||||
@@ -99,6 +112,10 @@ bootstrap-pkgs:
|
||||
pkg install -y devel/gmake
|
||||
pkg install -y archivers/pigz
|
||||
|
||||
# The .DEFAULT gets run if there is no Recipe denoted above for the
|
||||
# .Target (this includes release, ports, and tests) the only
|
||||
# difference between these and others is that the others are only
|
||||
# built if they or one of their dependencies has been changed
|
||||
.DEFAULT:
|
||||
@mkdir -p ${OBJDIR}
|
||||
@${BUILD_TOOLS}/buildenv.py ${MK} ${.TARGET}
|
||||
|
||||
@@ -35,10 +35,6 @@ RELEASE_LOGFILE?=${SCRIPT}
|
||||
RELEASE_LOGFILE?=${BE_ROOT}/release.build.log
|
||||
.endif
|
||||
|
||||
.if defined(CHANGELOG)
|
||||
.export CHANGELOG
|
||||
.endif
|
||||
|
||||
all: check-root build
|
||||
|
||||
.PHONY: world build packages checkout update dumpenv clean release ports docs tests
|
||||
@@ -84,7 +80,7 @@ clean-package:
|
||||
find ${OBJDIR}/ports -name "${p}*" | xargs rm -fr
|
||||
.else
|
||||
@echo "Clean a single package from object tree"
|
||||
@echo ""
|
||||
@echo ""
|
||||
@echo "Usage: ${MAKE} ${.TARGET} p=[package name]"
|
||||
@echo ""
|
||||
@echo "Examples:"
|
||||
|
||||
@@ -23,15 +23,12 @@
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
|
||||
PRODUCT = PRODUCT or "FreeNAS"
|
||||
COMPANY = COMPANY or "iXsystems"
|
||||
MIDDLEWARE_ROOT = "${BE_ROOT}/middleware"
|
||||
OS_ROOT = "${BE_ROOT}/os"
|
||||
PORTS_ROOT = "${BE_ROOT}/ports"
|
||||
TESTS_ROOT = "${BUILD_ROOT}/tests"
|
||||
|
||||
BUILD_PROFILES = "${BUILD_ROOT}/build/profiles"
|
||||
DEFAULT_PROFILE = "${BUILD_PROFILES}/default"
|
||||
PROFILE_ROOT = "${BUILD_PROFILES}/${PROFILE}"
|
||||
|
||||
PORTS_OVERLAY = "${OBJDIR}/ports-overlay"
|
||||
@@ -41,7 +38,6 @@ WORLD_DESTDIR = "${OBJDIR}/world"
|
||||
PACKAGES_DESTDIR = "${OBJDIR}/packages"
|
||||
INSTUFS_DESTDIR = "${OBJDIR}/instufs"
|
||||
ISO_DESTDIR = "${OBJDIR}/iso"
|
||||
CDROM_LABEL = PRODUCT
|
||||
FREEBSD_RELEASE_VERSION = "10.3-RELEASE"
|
||||
BUILD_ARCH = "amd64"
|
||||
BUILD_ARCH_SHORT = "x64"
|
||||
@@ -52,9 +48,8 @@ PRODUCTION = PRODUCTION or "no"
|
||||
# Also note that do not refer to any profile specific variable before
|
||||
# the file below can be included
|
||||
# Lastly, PLEASE LOOK AT THE PROFILE SPECIFIC FILE BEFORE YOU ADD THINGS HERE!
|
||||
if exists("${PROFILE_ROOT}/env.pyd"):
|
||||
# Include any profile specific variable in the file(s) below.
|
||||
include("${PROFILE_ROOT}/env.pyd")
|
||||
# Include any profile specific variable in the file(s) below.
|
||||
include("${PROFILE_ROOT}/env.pyd")
|
||||
|
||||
if MILESTONE == "MASTER":
|
||||
# Version
|
||||
@@ -84,10 +79,6 @@ BUILD_TOOLS = "${BUILD_ROOT}/build/tools"
|
||||
DISTFILES_CACHE = "${OBJDIR}/ports/distfiles"
|
||||
XZ = XZ or "pxz"
|
||||
|
||||
# URLs
|
||||
PROJECT_SITE = "http://www.freenas.org"
|
||||
SUPPORT_SITE = "http://bugs.freenas.org"
|
||||
|
||||
# Release bits
|
||||
TRAIN = TRAIN or "${PRODUCT}-${VERSION_NUMBER}-Nightlies"
|
||||
RELEASE_STAGEDIR = "${BE_ROOT}/release/${PRODUCT}-${VERSION}"
|
||||
@@ -95,20 +86,6 @@ UPGRADE_STAGEDIR = "${BE_ROOT}/release/${TRAIN}-${BUILD_TIMESTAMP}-Update"
|
||||
LATEST = "${OBJDIR}/LATEST"
|
||||
RELEASE_DOCS_PATH = "${BUILD_ROOT}/release/${VERSION_NUMBER}/${PRODUCT}/RELEASE/"
|
||||
|
||||
# release-push settings
|
||||
# Check whether it is an internal update or not
|
||||
INTERNAL_UPDATE = INTERNAL_UPDATE or "NO"
|
||||
# Check for garbage values provided by user
|
||||
if INTERNAL_UPDATE.lower() not in ["yes", "no"]:
|
||||
print("Malformed Value provided for INTERNAL_UPDATE: {0}. Use 'YES'or 'NO'".format(INTERNAL_UPDATE))
|
||||
INTERNAL_UPDATE = "NO"
|
||||
if INTERNAL_UPDATE.lower() == "yes":
|
||||
update_host_user_pair = ("update-int.ixsystems.com", "releng")
|
||||
else:
|
||||
update_host_user_pair = ("update-master.freenas.org", "sef")
|
||||
|
||||
UPDATE_HOST = UPDATE_HOST or update_host_user_pair[0]
|
||||
UPDATE_USER = UPDATE_USER or update_host_user_pair[1]
|
||||
UPDATE_DB = "sqlite:${PRODUCT}-updates.db"
|
||||
UPDATE_DEST = "/tank/www/${PRODUCT}"
|
||||
FREENAS_KEYFILE = FREENAS_KEYFILE or "/dev/null"
|
||||
@@ -116,9 +93,6 @@ DOWNLOAD_BASEDIR = "/downloads"
|
||||
DOWNLOAD_PREFIX = "${DOWNLOAD_BASEDIR}/${VERSION_NUMBER}"
|
||||
IX_INTERNAL_PATH_PREFIX = "/builds/${PRODUCT}"
|
||||
|
||||
if PRODUCT == "FreeNAS":
|
||||
DOWNLOAD_HOST = "download.freenas.org"
|
||||
|
||||
# Debug info location
|
||||
DEBUG_ROOT = "${OBJDIR}/debug"
|
||||
DEBUG_WORLD = "${DEBUG_ROOT}/world"
|
||||
|
||||
@@ -34,7 +34,7 @@ profile = {
|
||||
"status": "active"
|
||||
}
|
||||
|
||||
kernel_config = "${DEFAULT_PROFILE}/kernel/FREENAS.amd64"
|
||||
kernel_config = "${PROFILE_ROOT}/kernel/FREENAS.amd64"
|
||||
|
||||
kernel_modules = [
|
||||
"cc",
|
||||
|
||||
@@ -1,6 +1,33 @@
|
||||
PRODUCT = PRODUCT or "FreeNAS"
|
||||
COMPANY = COMPANY or "iXsystems"
|
||||
CDROM_LABEL = PRODUCT
|
||||
|
||||
MILESTONE = MILESTONE or "MASTER"
|
||||
VERSION_NUMBER = "10"
|
||||
SRC_ROOT = "${MIDDLEWARE_ROOT}/src"
|
||||
|
||||
DOWNLOAD_HOST = "download.freenas.org"
|
||||
|
||||
# CHANGELOG := "${BUILD_ROOT}/release/10/FreeNAS/BETA2/ChangeLog"
|
||||
|
||||
# URLs
|
||||
PROJECT_SITE = "http://www.freenas.org"
|
||||
SUPPORT_SITE = "http://bugs.freenas.org"
|
||||
|
||||
# release-push settings
|
||||
# Check whether it is an internal update or not
|
||||
INTERNAL_UPDATE = INTERNAL_UPDATE or "NO"
|
||||
# Check for garbage values provided by user
|
||||
if INTERNAL_UPDATE.lower() not in ["yes", "no"]:
|
||||
print("Malformed Value provided for INTERNAL_UPDATE: {0}. Use 'YES'or 'NO'".format(INTERNAL_UPDATE))
|
||||
INTERNAL_UPDATE = "NO"
|
||||
if INTERNAL_UPDATE.lower() == "yes":
|
||||
update_host_user_pair = ("update-int.ixsystems.com", "releng")
|
||||
else:
|
||||
update_host_user_pair = ("update-master.freenas.org", "sef")
|
||||
|
||||
UPDATE_HOST = UPDATE_HOST or update_host_user_pair[0]
|
||||
UPDATE_USER = UPDATE_USER or update_host_user_pair[1]
|
||||
|
||||
if exists("${MIDDLEWARE_ROOT}"):
|
||||
GIT_REVISION = sh("git -C ${MIDDLEWARE_ROOT} rev-parse --verify --short HEAD")
|
||||
GIT_REVISION = sh("git -C ${MIDDLEWARE_ROOT} rev-parse --verify --short HEAD")
|
||||
|
||||
@@ -1,8 +1,35 @@
|
||||
PRODUCT = PRODUCT or "FreeNAS"
|
||||
COMPANY = COMPANY or "iXsystems"
|
||||
CDROM_LABEL = PRODUCT
|
||||
|
||||
MILESTONE = MILESTONE or "MASTER"
|
||||
VERSION_NUMBER = "9.10"
|
||||
FREENAS_ROOT = "${BE_ROOT}/freenas"
|
||||
SRC_ROOT = "${FREENAS_ROOT}/src"
|
||||
|
||||
DOWNLOAD_HOST = "download.freenas.org"
|
||||
|
||||
CHANGELOG := "${BUILD_ROOT}/release/9.10/FreeNAS/RELEASE/ChangeLog"
|
||||
|
||||
# URLs
|
||||
PROJECT_SITE = "http://www.freenas.org"
|
||||
SUPPORT_SITE = "http://bugs.freenas.org"
|
||||
|
||||
# release-push settings
|
||||
# Check whether it is an internal update or not
|
||||
INTERNAL_UPDATE = INTERNAL_UPDATE or "NO"
|
||||
# Check for garbage values provided by user
|
||||
if INTERNAL_UPDATE.lower() not in ["yes", "no"]:
|
||||
print("Malformed Value provided for INTERNAL_UPDATE: {0}. Use 'YES'or 'NO'".format(INTERNAL_UPDATE))
|
||||
INTERNAL_UPDATE = "NO"
|
||||
if INTERNAL_UPDATE.lower() == "yes":
|
||||
update_host_user_pair = ("update-int.ixsystems.com", "releng")
|
||||
else:
|
||||
update_host_user_pair = ("update-master.freenas.org", "sef")
|
||||
|
||||
UPDATE_HOST = UPDATE_HOST or update_host_user_pair[0]
|
||||
UPDATE_USER = UPDATE_USER or update_host_user_pair[1]
|
||||
|
||||
if exists("${FREENAS_ROOT}"):
|
||||
GIT_REVISION = sh("git -C ${FREENAS_ROOT} rev-parse --verify --short HEAD")
|
||||
|
||||
|
||||
1
build/profiles/profile-setting
Normal file
1
build/profiles/profile-setting
Normal file
@@ -0,0 +1 @@
|
||||
freenas9
|
||||
Reference in New Issue
Block a user