| # |
| # Copyright (c) 2010-2011 Nest, 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 makefile for embedded Linux "Swiss Army Knife" |
| # application, BusyBox. |
| # |
| |
| include pre.mak |
| |
| PackageName := busybox |
| |
| PackageExtension := tar.bz2 |
| PackageSeparator := - |
| |
| PackagePatchArgs := -p1 |
| |
| PackageArchive := $(PackageName).$(PackageExtension) |
| PackageSourceDir := $(PackageName)$(PackageSeparator)$(PackageVersion) |
| |
| PackageBuildMakefile = $(call GenerateBuildPaths,Makefile) |
| |
| CleanPaths += $(PackageLicenseFile) |
| |
| SOURCEDIRS = $(PackageSourceDir) configs |
| $(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/configure |
| configs_RULE_TARGET = $(BuildDirectory)/configure |
| |
| all: $(PackageDefaultGoal) |
| |
| # Generate the package license contents. |
| |
| $(PackageSourceDir)/LICENSE: $(BuildDirectory)/source |
| |
| $(PackageLicenseFile): $(PackageSourceDir)/LICENSE |
| $(copy-result) |
| |
| # Extract the source from the archive and apply patches, if any. |
| |
| $(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths) |
| $(expand-and-patch-package) |
| |
| # Prepare the sources. |
| |
| $(BuildDirectory)/source: | $(PackageSourceDir) |
| $(Verbose)touch $@ |
| |
| # Patch the sources, if necessary. |
| |
| $(BuildDirectory)/patch: $(BuildDirectory)/source |
| $(Verbose)touch $@ |
| |
| # BusyBox has no way of explicitly setting CC, LD, OBJCOPY, et al and |
| # instead relies on the value of CROSS_COMPILE. Consequently, we have |
| # to ensure that 'ToolBinDir' is in 'PATH' so that the kernel build |
| # infrastructure can find $(CROSS_COMPILE)gcc, $(CROSS_COMPILE)ld, et |
| # al. |
| |
| $(BuildDirectory)/configure $(BuildDirectory)/build $(BuildDirectory)/stage: PATH := $(PATH):$(ToolBinDir) |
| |
| # Generate the package build makefile and default configuration based |
| # on the build configuration. |
| |
| # Configure the source for building. |
| |
| $(BuildDirectory)/configure: $(BuildDirectory)/source $(CURDIR)/configs/$(BuildConfig)_defconfig | $(PackageSourceDir) $(BuildDirectory) |
| $(Verbose)$(MAKE) $(JOBSFLAG) -C $(PackageSourceDir) O=$(CURDIR)/$(BuildDirectory) $(CURDIR)/configs/$(BuildConfig)_defconfig |
| $(Verbose)touch $@ |
| |
| # Build the source. |
| |
| $(BuildDirectory)/build: $(BuildDirectory)/configure |
| $(Verbose)$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) busybox |
| $(Verbose)touch $@ |
| |
| # Stage the build to a temporary installation area. |
| |
| $(BuildDirectory)/stage: $(BuildDirectory)/build | $(ResultDirectory) |
| $(Verbose)$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) INSTALL="$(INSTALL) $(INSTALLFLAGS)" CONFIG_PREFIX=$(ResultDirectory) install |
| $(Verbose)touch $@ |
| |
| .PHONY: stage |
| stage: $(BuildDirectory)/stage |
| |
| clean: |
| $(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir) |
| $(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory) |
| $(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory) |
| |
| include post.mak |