mirror of
https://github.com/truenas/core-build.git
synced 2026-02-15 07:36:18 +00:00
Create, remap, and implement the profile-setting file, remove a redundant IF statement and clean-up/add clarity A checkout prior to this point will yield: * The profile-setting does not exist and a redundant IF statement is present and the Makefile is not viewable friendly
122 lines
4.0 KiB
Makefile
122 lines
4.0 KiB
Makefile
#-
|
|
# 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.
|
|
#
|
|
# 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_STARTED != date '+%s'
|
|
|
|
BUILD_ROOT ?= ${.CURDIR}
|
|
BUILD_CONFIG := ${BUILD_ROOT}/build/config
|
|
BUILD_TOOLS := ${BUILD_ROOT}/build/tools
|
|
PYTHONPATH := ${BUILD_ROOT}/build/lib
|
|
MK := ${MAKE} -f ${BUILD_ROOT}/Makefile.inc1
|
|
|
|
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
|
|
|
|
.export BUILD_TIMESTAMP
|
|
.export BUILD_STARTED
|
|
|
|
.export BUILD_ROOT
|
|
.export BUILD_CONFIG
|
|
.export BUILD_TOOLS
|
|
.export PYTHONPATH
|
|
.export MK
|
|
|
|
.export PROFILE
|
|
|
|
.export GIT_REPO_SETTING
|
|
.export GIT_LOCATION
|
|
|
|
.export BE_ROOT
|
|
.export OBJDIR
|
|
.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}"
|
|
|
|
@${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:
|
|
@${BUILD_TOOLS}/buildenv.py sh
|
|
|
|
bootstrap-pkgs:
|
|
pkg install -y archivers/pxz
|
|
pkg install -y lang/python3
|
|
pkg install -y ports-mgmt/poudriere-devel
|
|
pkg install -y sysutils/grub2-pcbsd
|
|
pkg install -y sysutils/xorriso
|
|
pkg install -y sysutils/grub2-efi
|
|
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}
|