Makefile revision 3649
9dae059450bb6954fa548f86779ef90312be74bdDav Glass#
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# CDDL HEADER START
9dae059450bb6954fa548f86779ef90312be74bdDav Glass#
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# The contents of this file are subject to the terms of the
e5d90d0a84af3c76d6f7a8625caf9eb028680726Dav Glass# Common Development and Distribution License (the "License").
e5d90d0a84af3c76d6f7a8625caf9eb028680726Dav Glass# You may not use this file except in compliance with the License.
e5d90d0a84af3c76d6f7a8625caf9eb028680726Dav Glass#
e5d90d0a84af3c76d6f7a8625caf9eb028680726Dav Glass# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e5d90d0a84af3c76d6f7a8625caf9eb028680726Dav Glass# or http://www.opensolaris.org/os/licensing.
aa21e7e5a0527e42135e15729423313faf515e23Dav Glass# See the License for the specific language governing permissions
8367c40f471b6d7692cc67b0ad710817521d835dDav Glass# and limitations under the License.
31fda9ac7c62c1555a44b50f6c266d58d0e17260Dav Glass#
31fda9ac7c62c1555a44b50f6c266d58d0e17260Dav Glass# When distributing Covered Code, include this CDDL HEADER in each
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# If applicable, add the following below this CDDL HEADER, with the
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# fields enclosed by brackets "[]" replaced with your own identifying
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# information: Portions Copyright [yyyy] [name of copyright owner]
9dae059450bb6954fa548f86779ef90312be74bdDav Glass#
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# CDDL HEADER END
9dae059450bb6954fa548f86779ef90312be74bdDav Glass#
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
9dae059450bb6954fa548f86779ef90312be74bdDav Glass#
9dae059450bb6954fa548f86779ef90312be74bdDav Glassinclude ../../make-rules/shared-macros.mk
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_NAME= sendmail
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_VERSION= 8.14.9
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_PROJECT_URL= ftp://ftp.sendmail.org/pub/sendmail/
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_ARCHIVE= $(COMPONENT_NAME).$(COMPONENT_VERSION).tar.gz
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_ARCHIVE_HASH= \
9dae059450bb6954fa548f86779ef90312be74bdDav Glass sha256:f5a497151abd8f341cca0736c3f9bd703d574d93146b2989689dff6d7a445d75
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).sig
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_BUGDB= utility/sendmail
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav GlassTPNO= 7435
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav Glassinclude ../../make-rules/prep.mk
9dae059450bb6954fa548f86779ef90312be74bdDav Glassinclude ../../make-rules/justmake.mk
9dae059450bb6954fa548f86779ef90312be74bdDav Glassinclude ../../make-rules/ips.mk
9dae059450bb6954fa548f86779ef90312be74bdDav Glassinclude ../../make-rules/lint-libraries.mk
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav GlassPKG_PROTO_DIRS += $(BUILD_DIR_32)
9dae059450bb6954fa548f86779ef90312be74bdDav GlassPKG_PROTO_DIRS += $(BUILD_DIR_32)/obj.SunOS.$(OS_VERSION).$(ARCH)
9dae059450bb6954fa548f86779ef90312be74bdDav GlassPKG_PROTO_DIRS += $(COMPONENT_DIR)/files
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassPKG_PROTO_DIRS += $(COMPONENT_DIR)/files/man
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass# Userland default includes -mt which links with libthread which we don't need.
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glassstudio_MT =
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass# We set ARCH to match sendmail's configure-like script: on x86, it simply
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass# uses 'uname -m', but on sparc it shortens "sun4*" into "sun4".
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassARCH := $(shell uname -m)
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glassifeq ($(findstring sun4,$(ARCH)),sun4)
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassARCH = sun4
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glassendif
9dae059450bb6954fa548f86779ef90312be74bdDav GlassFILE_DIR=$(COMPONENT_DIR)/files
9dae059450bb6954fa548f86779ef90312be74bdDav GlassM4_ARG=-DSUN_HIDE_INTERNAL_DETAILS
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassSM_BUILD_SUB_DIR=obj.SunOS.$(OS_VERSION).$(ARCH)
64c6e02eab1938ea506b95e4146200cbbcced599Dav GlassSM_BUILD_DIR=$(@D)/$(SM_BUILD_SUB_DIR)
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCLEAN_PATHS += $(FILE_DIR)/aux/mailq
64c6e02eab1938ea506b95e4146200cbbcced599Dav Glass
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass# This appends "+Sun" to the version string, which we do for historical
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass# reasons. If we did this via patch, then we would have to revise the patch
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass# with every new release, since the version string changes every time.
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassCOMPONENT_PREP_ACTION = $(GSED) -i -e 's/\(Version\[\] = "8\.[^"]*\)/\1+Sun/' \
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass $(COMPONENT_SRC)/sendmail/version.c
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass# libmilter and sendmail must come before include, so appending to the default
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# value of LINT_FLAGS will not work; we must redefine it here.
9dae059450bb6954fa548f86779ef90312be74bdDav GlassSM_DEFS= -DSOLARIS=21200
9dae059450bb6954fa548f86779ef90312be74bdDav GlassSM_INCLUDES= -I$(SM_BUILD_DIR)/libmilter -I$(SOURCE_DIR)/sendmail \
9dae059450bb6954fa548f86779ef90312be74bdDav Glass -I$(SOURCE_DIR)/include -I$(SOURCE_DIR) -I.
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassLINT_FLAGS = -nsvx $(SM_DEFS) $(SM_INCLUDES)
64c6e02eab1938ea506b95e4146200cbbcced599Dav GlassCCOPTS = -erroff=E_STATEMENT_NOT_REACHED $(CC_BITS)
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_BUILD_ARGS += CC="$(CC)"
64c6e02eab1938ea506b95e4146200cbbcced599Dav GlassCOMPONENT_BUILD_ARGS += CCOPTS="$(CCOPTS)"
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassCOMPONENT_BUILD_ARGS += CCLINK="$(LD)"
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_BUILD_ARGS += LDOPTS="$(CC_BITS)"
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_POST_BUILD_ACTION = cd $(FILE_DIR)/aux ; $(GMAKE) build
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassCOMPONENT_POST_INSTALL_ACTION += cd $(FILE_DIR)/aux ; $(GMAKE) install ;
64c6e02eab1938ea506b95e4146200cbbcced599Dav GlassCOMPONENT_POST_INSTALL_ACTION += \
9dae059450bb6954fa548f86779ef90312be74bdDav Glass $(CP) $(FILE_DIR)/cf/domain/solaris-generic.m4 $(@D)/cf/domain/ ;
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_POST_INSTALL_ACTION += \
64c6e02eab1938ea506b95e4146200cbbcced599Dav Glass $(CP) $(FILE_DIR)/cf/cf/sendmail.mc $(@D)/cf/cf/ ;
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassCOMPONENT_POST_INSTALL_ACTION += \
9dae059450bb6954fa548f86779ef90312be74bdDav Glass cd $(@D)/cf/cf ; \
9dae059450bb6954fa548f86779ef90312be74bdDav Glass $(RM) submit.cf ; \
9dae059450bb6954fa548f86779ef90312be74bdDav Glass m4 $(M4_ARG) ../m4/cf.m4 submit.mc > submit.cf ; \
9dae059450bb6954fa548f86779ef90312be74bdDav Glass m4 $(M4_ARG) ../m4/cf.m4 sendmail.mc > sendmail.cf
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass
64c6e02eab1938ea506b95e4146200cbbcced599Dav GlassCOMPONENT_TEST_ARGS += CC="$(CC)"
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_TEST_ARGS += CCOPTS="$(CCOPTS)"
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_TEST_ARGS += CCLINK="$(LD)"
64c6e02eab1938ea506b95e4146200cbbcced599Dav GlassCOMPONENT_TEST_ARGS += LDOPTS="$(CC_BITS)"
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_TEST_ENV += PATH=/usr/gnu/bin:/usr/bin
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav GlassCOMPONENT_TEST_TRANSFORMS += \
9dae059450bb6954fa548f86779ef90312be74bdDav Glass '-e "s|$(SM_BUILD_SUB_DIR)|\\$$(SM_BUILD_SUB_DIR)|g" ' \
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass '-e "s|$(OS_VERSION)|\\$$(OS_VERSION)|g" ' \
64c6e02eab1938ea506b95e4146200cbbcced599Dav Glass '-e "s|$(ARCH)|\\$$(ARCH)|g" ' \
9dae059450bb6954fa548f86779ef90312be74bdDav Glass '-e "s|$(CC)|\\$$(CC)|g" '
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
64c6e02eab1938ea506b95e4146200cbbcced599Dav GlassASLR_MODE = $(ASLR_ENABLE)
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav GlassINSTALL_32=
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav Glass# common targets
9dae059450bb6954fa548f86779ef90312be74bdDav Glassbuild: $(BUILD_32)
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav Glass
64c6e02eab1938ea506b95e4146200cbbcced599Dav Glassinstall: $(INSTALL_32)
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav Glasstest: $(TEST_32)
64c6e02eab1938ea506b95e4146200cbbcced599Dav Glass
6f3ae49d2c323c8a52f4e09a0bf08f743c5f24f4Dav GlassBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
9dae059450bb6954fa548f86779ef90312be74bdDav Glass
9dae059450bb6954fa548f86779ef90312be74bdDav Glassinclude ../../make-rules/depend.mk
9dae059450bb6954fa548f86779ef90312be74bdDav Glass