blob: 0365ead8bda79596e55d3743e90787878c94fa79 [file] [log] [blame]
#
# Copyright (c) 2010-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 the daemon-monitoring daemon
# (DMD), monit.
#
BuildConfigSpecialized := No
BuildProductSpecialized := No
include pre.mak
PackageName := monit
PackageExtension := tar.gz
PackageSeparator := -
PackagePatchArgs := -p1
PackageArchive := $(PackageName).$(PackageExtension)
PackageSourceDir := $(PackageName)$(PackageSeparator)$(PackageVersion)
PackageBuildMakefile = $(call GenerateBuildPaths,Makefile)
PackageBuildConfigure = $(call GenerateBuildPaths,configure)
LicenseSourceFiles := LICENSE COPYING
LicenseSourcePaths := $(addprefix $(PackageSourceDir)/,$(LicenseSourceFiles))
CleanPaths += $(PackageLicenseFile)
OpenSSLDir := sw/tps/openssl
OpenSSLIncDir := $(call GenerateResultPaths,$(OpenSSLDir),usr/include)
OpenSSLLibDir := $(call GenerateResultPaths,$(OpenSSLDir),usr/lib)
ZlibDir := sw/tps/zlib
ZlibIncDir := $(call GenerateResultPaths,$(ZlibDir),usr/include)
ZlibLibDir := $(call GenerateResultPaths,$(ZlibDir),usr/lib)
all: $(PackageDefaultGoal)
# Generate the package license contents.
$(LicenseSourcePaths): source
$(PackageLicenseFile): $(LicenseSourcePaths)
$(Verbose)touch $@
$(Verbose)for file in $(LicenseSourcePaths); do \
echo "Concatenating \"$${file}\"..."; \
cat $${file} >> $@; \
done
# Extract the source from the archive and apply patches, if any.
$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
$(expand-and-patch-package)
# Prepare the sources.
.PHONY: source
source: | $(PackageSourceDir)
# Patch the sources, if necessary.
.PHONY: patch
patch: source
# Generate the package build configure script by shadowing the source
# tree as a link farm.
#
# This is generally unnecessary for most GNU autoconf-based packages;
# however, monit completely drops the ball on non-colocated builds.
$(PackageBuildConfigure): | $(PackageSourceDir) $(BuildDirectory)
$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
# Generate the package build makefile.
$(PackageBuildMakefile): $(PackageBuildConfigure)
$(Verbose)cd $(BuildDirectory) && \
./configure \
--config-cache \
CC="$(CC)" CXX="$(CXX)" AR=$(AR) RANLIB=$(RANLIB) STRIP=$(STRIP) NM=$(NM) OBJDUMP=$(OBJDUMP) \
LDFLAGS="-Wl,-rpath-link -Wl,$(ZlibLibDir)" \
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
libmonit_cv_setjmp_available=yes \
libmonit_cv_vsnprintf_c99_conformant=yes \
ac_cv_ipv6=yes \
--build=$(HostTuple) \
--host=$(TargetTuple) \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-optimized \
--with-ssl-incl-dir=$(OpenSSLIncDir) \
--with-ssl-lib-dir=$(OpenSSLLibDir) \
--without-pam
# Configure the source for building.
.PHONY: configure
configure: source $(PackageBuildMakefile)
# Build the source.
#
# We have to unset MAKEFLAGS since they confuse the package build otherwise.
.PHONY: build
build: configure
$(Verbose)unset MAKEFLAGS && \
$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) all
# Stage the build to a temporary installation area.
#
# We have to unset MAKEFLAGS since they confuse the package build otherwise.
.PHONY: stage
stage: build | $(ResultDirectory)
$(Verbose)unset MAKEFLAGS && \
$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
DESTDIR=$(ResultDirectory) \
MODE_PROGS=775 \
install
clean:
$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
include post.mak