blob: b3cd313059461b33edf1db8233e06ae7c905ab45 [file] [log] [blame] [edit]
#
# Copyright (c) 2013 Nest Labs, Inc.
# All rights reserved.
#
# This document is the property of Nest. It is considered
# confidential and proprietary information.
#
# This document may not be reproduced or transmitted in any form,
# in whole or in part, without the express written permission of
# Nest.
#
# Description:
# This file is the make file for various FreeBSD user- and
# kernel-space sources.
#
BuildConfigSpecialized := No
BuildProductSpecialized := No
.DEFAULT_GOAL := all
include pre.mak
PackageRoot := .
PackageName := freebsd
PackagePatchArgs := -p1
PackageSourceDir := $(PackageRoot)/$(PackageName)
FreeBSDMakefile := $(PackageName).mak
LicenseSourceFile := $(PackageSourceDir)/COPYRIGHT
CleanPaths += $(PackageLicenseFile)
export PackageSourceDir
export PackageName
all: $(PackageDefaultGoal)
# Generate the package license contents.
$(LicenseSourceFile): source
$(PackageLicenseFile): $(LicenseSourceFile)
$(copy-result)
# We are building this package from version-controlled source, so
# there is nothing to do for this target goal.
$(PackageSourceDir):
# Prepare the sources.
.PHONY: source
source: | $(PackageSourceDir)
# Patch the sources, if necessary.
.PHONY: patch
patch: source
# Configure the source for building.
.PHONY: configure
configure: patch
# Build the source.
#
# Because we've just cherry-picked select FreeBSD sources and those
# does not have any make or build infrastructure of their own, we
# delegate the entirety of making FreeBSD to another adjunct make file
# of our own.
.PHONY: build
build: configure
$(Verbose)$(MAKE) -f $(FreeBSDMakefile) all
# Stage the build to a temporary installation area.
#
# There's nothing to do as the adjunct make file handles everything.
.PHONY: stage
stage: build
clean:
$(Verbose)$(MAKE) -s -f $(FreeBSDMakefile) $(@)
include post.mak