Makefile revision 5051
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen# CDDL HEADER START
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# The contents of this file are subject to the terms of the
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen# Common Development and Distribution License (the "License").
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# You may not use this file except in compliance with the License.
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# See the License for the specific language governing permissions
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# and limitations under the License.
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# If applicable, add the following below this CDDL HEADER, with the
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# CDDL HEADER END
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
b87436ebb957a9eb182be72ba00e2c8eae59a2e4Timo SirainenCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
fc84f8af4794f4bb6caf6e5ec3fb1f8cebd0462aTimo SirainenCOMPONENT_PROJECT_URL= ftp://ftp.sendmail.org/pub/sendmail/
b8a4aab1f117f6760184ad50b1af41ba810b51f9Timo SirainenCOMPONENT_ARCHIVE= $(COMPONENT_NAME).$(COMPONENT_VERSION).tar.gz
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen sha256:24f94b5fd76705f15897a78932a5f2439a32b1a2fdc35769bb1a5f5d9b4db439
12dc81583d1958cb301a617e19fbd40e8d376397Timo SirainenCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenCOMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).sig
12dc81583d1958cb301a617e19fbd40e8d376397Timo Sirainen# Mostly but not completely migrated from ON in S12.
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# Although we build 32_and_64, everything except libmilter just wants 64,
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainen# which is why the macros just below only have values for 64. libmilter
9b61a6db87c026656f8d2ae214e4486b98a069c0Timo Sirainen# is dealt with further below.
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenPKG_PROTO_DIRS += $(BUILD_DIR_64)/obj.SunOS.$(OS_VERSION).$(ARCH)
12dc81583d1958cb301a617e19fbd40e8d376397Timo Sirainen# Userland default includes -mt which links with libthread which we don't need.
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen# We set ARCH to match sendmail's configure-like script: on x86, it simply
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen# uses 'uname -m', but on sparc it shortens "sun4*" into "sun4".
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo SirainenSM_BUILD_SUB_DIR=obj.SunOS.$(OS_VERSION).$(ARCH)
048e40f9364fa68482bc276dd4a5d595a3d742e9Timo Sirainen# libmilter is built 32- and 64-bit, but its Makefile installs into a common
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# location, so we use the macro below in its manifest to distinguish between
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# the different built objects.
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenPKG_MACROS += LIBMILTER_BUILD_DIR=$(SM_BUILD_SUB_DIR)
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# This appends "+Sun" to the version string, which we do for historical
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen# reasons. If we did this via patch, then we would have to revise the patch
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# with every new release, since the version string changes every time.
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenCOMPONENT_PREP_ACTION = $(GSED) -i -e 's/\(Version\[\] = "8\.[^"]*\)/\1+Sun/' \
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# libmilter and sendmail must come before include, so appending to the default
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# value of LINT_FLAGS will not work; we must redefine it here.
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo SirainenSM_DEFS= -DSOLARIS=$(shell echo $(SOLARIS_VERSION) | \
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo SirainenSM_INCLUDES= -I$(SM_BUILD_DIR)/libmilter -I$(SOURCE_DIR)/sendmail \
82995cc154a929f37aa486a72a6485e9f8d34a30Timo SirainenCCOPTS = -erroff=E_STATEMENT_NOT_REACHED $(CC_BITS)
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# mailq's Makefile doesn't grok the 32- and 64-bit build. We just want 64.
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen# So we clean before we build, and the last build (64) wins, which is what
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenCOMPONENT_POST_BUILD_ACTION = cd $(FILE_DIR)/aux ; \
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo SirainenCOMPONENT_POST_INSTALL_ACTION += cd $(FILE_DIR)/aux ; $(GMAKE) install ;
d23c747de9d33966483fbdd41f08ad7766da7c5cTimo Sirainen $(CP) $(FILE_DIR)/cf/domain/solaris-generic.m4 $(@D)/cf/domain/ ;
2d8b23805db6f06b8b38174fb6e135386694f429Timo Sirainen $(CP) $(FILE_DIR)/cf/cf/sendmail.mc $(@D)/cf/cf/ ;
2d8b23805db6f06b8b38174fb6e135386694f429Timo Sirainen# Without the two $(CP)s below we would pick up the version of submit.cf
766115d2b2e6dbcf59f90d3b3866851cf6f740feTimo Sirainen# from under $(COMPONENT_SRC), which is not what we want because it contains
766115d2b2e6dbcf59f90d3b3866851cf6f740feTimo Sirainen# information (user, hostname, date, build path) from the upstream machine
766115d2b2e6dbcf59f90d3b3866851cf6f740feTimo Sirainen# where the distro was created. So we build our own version here, using
766115d2b2e6dbcf59f90d3b3866851cf6f740feTimo Sirainen# $(M4_ARG), which suppresses the inclusion of all that information.
2d8b23805db6f06b8b38174fb6e135386694f429Timo Sirainen# Then we copy it to $(PROTO_DIR)/cf/cf instead of the more intuitive
2d8b23805db6f06b8b38174fb6e135386694f429Timo Sirainen# $(PROTOETCDIR)/mail/cf/cf to match the transform in the manifest that
b1678954f83e1059b981e2def52a70054fa71399Timo Sirainen# picks up everything under etc/mail/cf/ from cf/ instead.
0e5819a061034f1636b124c03a89f67d37c852b1Timo Sirainen m4 $(M4_ARG) ../m4/cf.m4 submit.mc > submit.cf ; \
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen m4 $(M4_ARG) ../m4/cf.m4 sendmail.mc > sendmail.cf
8eb223b84389a7b75a39d46484f5166d221305ebTimo SirainenCOMPONENT_TEST_ENV += PATH=/usr/gnu/bin:/usr/bin
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# The transforms below abstract out the 32- or 64-bit specific parts of
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen# the results, so we can use a common "all" master file.
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo SirainenCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainen '-e "s|$(SM_BUILD_SUB_DIR)|\\$$(SM_BUILD_SUB_DIR)|g" ' \
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen '-e "s|$(OS_VERSION)|\\$$(OS_VERSION)|g" ' \
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainen '-e "s|$(ARCH)|\\$$(ARCH)|g" ' \
30ad2b0309119501efad06c72ec9b1561b90d4afTimo Sirainen '-e "s|^$(CC).*$$|XXX_CC_XXX|g" ' \
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo Sirainen '-e "/^XXX_CC_XXX\\$$/d" '
bc7a4cf2c06702ebaedba9a7c15ce657d5856f63Timo Sirainen# common targets