Makefile revision 5389
4be39ac606cc80de5b28e745a94b099557387ff7vboxsync#
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# CDDL HEADER START
71955773a7f477f9a159a491f765ba97e1f00e1avboxsync#
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# The contents of this file are subject to the terms of the
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# Common Development and Distribution License (the "License").
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# You may not use this file except in compliance with the License.
71955773a7f477f9a159a491f765ba97e1f00e1avboxsync#
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# or http://www.opensolaris.org/os/licensing.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# See the License for the specific language governing permissions
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# and limitations under the License.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync#
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# When distributing Covered Code, include this CDDL HEADER in each
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# If applicable, add the following below this CDDL HEADER, with the
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# fields enclosed by brackets "[]" replaced with your own identifying
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync#
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync# CDDL HEADER END
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync#
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync#
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncBITS=64
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncinclude ../../make-rules/shared-macros.mk
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsyncCOMPONENT_NAME= grep
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsyncCOMPONENT_VERSION= 2.22
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsyncCOMPONENT_PROJECT_URL= http://gnu.org/software/grep/
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsyncCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsyncCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsyncCOMPONENT_ARCHIVE_HASH= \
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync sha256:ca91d22f017bfcb503d4bc3b44295491c89a33a3df0c3d8b8614f2d3831836eb
7e3a9a30ad06aaa937b5bfe12eef894f23091ec4vboxsyncCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/grep/$(COMPONENT_ARCHIVE)
7e3a9a30ad06aaa937b5bfe12eef894f23091ec4vboxsync
7e3a9a30ad06aaa937b5bfe12eef894f23091ec4vboxsyncCOMPONENT_BUGDB= utility/ggrep
7e3a9a30ad06aaa937b5bfe12eef894f23091ec4vboxsync
7e3a9a30ad06aaa937b5bfe12eef894f23091ec4vboxsyncTPNO= 26437
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncinclude $(WS_MAKE_RULES)/prep.mk
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncinclude $(WS_MAKE_RULES)/configure.mk
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncinclude $(WS_MAKE_RULES)/ips.mk
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# We need to be able to return from void functions
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncCFLAGS += $(studio_FEATURES_EXTENSIONS)
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# 64-bit only components are delivered to the "32-bit" locations since we don't
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# need both versions.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncCONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/gnu/bin
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncCONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# Enable aslr for this component
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncASLR_MODE = $(ASLR_ENABLE)
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# Needed for "gmake test" to work.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# SHELLOPTS is exported via make-rules/shared-macros.mk,
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# causing the braceexpand option to be set.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# This option causes "$1: unbound variable" errors during the check-TESTS,
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# and the gnulib-tests don't even run at all.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# Note that the below unexports SHELLOPTS, even for targets
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# other than "test."
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncunexport SHELLOPTS
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# Test transforms retain only relevant results output.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsyncCOMPONENT_TEST_TRANSFORMS += \
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync '-n ' \
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync '-e "/TOTAL/p" ' \
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync '-e "/SKIP/p" ' \
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync '-e "/PASS/p" ' \
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync '-e "/FAIL/p" ' \
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync '-e "/ERROR/p" '
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync
71955773a7f477f9a159a491f765ba97e1f00e1avboxsync# Putting GNU on path first prevents some tests from being skipped,
71955773a7f477f9a159a491f765ba97e1f00e1avboxsync# which also keeps the test and system-test results consistent.
71955773a7f477f9a159a491f765ba97e1f00e1avboxsync# With the test target, the path to the just-built commands is
71955773a7f477f9a159a491f765ba97e1f00e1avboxsync# prepended to PATH. With the system-test target, we patch
71955773a7f477f9a159a491f765ba97e1f00e1avboxsync# to prevent the PATH from being prepended.
71955773a7f477f9a159a491f765ba97e1f00e1avboxsyncCOMPONENT_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
71955773a7f477f9a159a491f765ba97e1f00e1avboxsyncCOMPONENT_SYSTEM_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# Patch to change test path so it tests grep commands from /usr/gnu/bin
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# installed on the test system. If we patch, we must re-configure the
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync# tests.
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync$(SOURCE_DIR)/.system-test-patched: $(SOURCE_DIR)/.prep
ad13c20995d0a1aafbfbd35b2d698ef2ff5fbeefvboxsync $(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $(COMPONENT_DIR)/system-test-patches/systest.patch
$(TOUCH) $(@)
# if we previously patched the source for the system-test target,
# ensure we rebuild without that patch
test-check:
if [ -e $(SOURCE_DIR)/.system-test-patched ]; then \
cd $(COMPONENT_DIR); \
$(GMAKE) clean build; \
fi
# common targets
configure: $(CONFIGURE_64)
build: $(BUILD_64)
install: $(INSTALL_64)
test: test-check $(TEST_64)
system-test: $(SOURCE_DIR)/.system-test-patched configure $(SYSTEM_TEST_64)
REQUIRED_PACKAGES += library/pcre
REQUIRED_PACKAGES += shell/bash
REQUIRED_PACKAGES += system/library