make-rules/gem.mk
author Vladimir Marek <Vladimir.Marek@oracle.com>
Tue, 04 Oct 2016 14:04:16 +0200
changeset 7129 6587d6b48782
parent 6608 a98160718cfc
permissions -rw-r--r--
24794975 Update DBD::mysql to 4.0.37 24794982 problem in PERL-MOD/DBD-MYSQL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     1
#
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     2
# CDDL HEADER START
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     3
#
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     7
#
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    11
# and limitations under the License.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    12
#
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    18
#
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    19
# CDDL HEADER END
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    20
#
5682
94c0ca64c022 15558602 TCL_LD_SEARCH_FLAGS is wrongly defined in tclConfig.sh
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5473
diff changeset
    21
94c0ca64c022 15558602 TCL_LD_SEARCH_FLAGS is wrongly defined in tclConfig.sh
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5473
diff changeset
    22
#
5328
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    23
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    24
#
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    25
GEM=/usr/ruby/$(RUBY_VERSION)/bin/gem
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    26
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    27
VENDOR_GEM_DIR=/usr/ruby/$(RUBY_VERSION)/lib/ruby/vendor_ruby/gems/$(RUBY_LIB_VERSION)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    28
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    29
# Name of the gem spec to use.  This will typically be
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    30
# <component_name>.gemspec
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    31
GEMSPEC=$(COMPONENT_NAME).gemspec
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    32
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    33
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    34
# Some gems projects have to be built using rake
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    35
# Allow GEM build/install commands to be overwritten
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    36
# to account for possible differences
5438
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5328
diff changeset
    37
GEM_BUILD_ACTION=(cd $(@D); $(GEM) build $(GEM_BUILD_ARGS) $(GEMSPEC))
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5328
diff changeset
    38
5473
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    39
# Build install args in a more readable fashion
5438
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5328
diff changeset
    40
ifeq ($(firstword $(subst .,$(space),$(RUBY_VERSION))),2)
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5328
diff changeset
    41
# gem install 2.x does docs differently. Continue to generate both types
5473
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    42
GEM_INSTALL_ARGS += --document rdoc,ri
5438
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5328
diff changeset
    43
endif
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    44
5473
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    45
GEM_INSTALL_ARGS += -V --local --force
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    46
GEM_INSTALL_ARGS += --install-dir $(PROTO_DIR)/$(VENDOR_GEM_DIR)
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    47
GEM_INSTALL_ARGS += --bindir $(PROTO_DIR)/$(VENDOR_GEM_DIR)/bin
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    48
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    49
# cd into build directory
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    50
# gem 2.2.3 uses .gem from the cwd ignoring command line .gem file
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    51
# gem 1.8.23.2 uses command line .gem file OR .gem from cwd
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    52
GEM_INSTALL_ACTION= (cd $(@D); $(GEM) install $(GEM_INSTALL_ARGS) $(COMPONENT_NAME))
b43979b0c196 22756317 hiera is not building correctly (gem 2.x builds differently)
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5438
diff changeset
    53
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    54
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    55
$(BUILD_DIR)/%/.built:  $(SOURCE_DIR)/.prep
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    56
	$(RM) -r $(@D) ; $(MKDIR) $(@D)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    57
	$(CLONEY) $(SOURCE_DIR) $(@D)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    58
	$(COMPONENT_PRE_BUILD_ACTION)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    59
	# Build the gem and cause the generation of a new gem spec
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    60
	# file in $(COMPONENT_SRC)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    61
	$(GEM_BUILD_ACTION)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    62
	$(COMPONENT_POST_BUILD_ACTION)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    63
	$(TOUCH) $@
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    64
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    65
$(BUILD_DIR)/%/.installed:      $(BUILD_DIR)/%/.built
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    66
	$(COMPONENT_PRE_INSTALL_ACTION)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    67
	$(MKDIR) $(PROTO_DIR)/$(GEM_DIR)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    68
	# Install the new recreated gem
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    69
	$(GEM_INSTALL_ACTION)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    70
	$(COMPONENT_POST_INSTALL_ACTION)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    71
	$(TOUCH) $@
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    72
5328
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    73
COMPONENT_TEST_TARGETS =
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    74
COMPONENT_SYSTEM_TEST_TARGETS = 
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    75
6608
a98160718cfc 24363814 test-and-compare shouldn't redirect output to a file if the command is doing so
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    76
# Test the built source.  If the output file shows up in the environment or
a98160718cfc 24363814 test-and-compare shouldn't redirect output to a file if the command is doing so
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    77
# arguments, don't redirect stdout/stderr to it.
5328
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    78
$(BUILD_DIR)/%/.tested-and-compared:    $(BUILD_DIR)/%/.built
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    79
	$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    80
	$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    81
	$(COMPONENT_PRE_TEST_ACTION)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    82
	-(cd $(COMPONENT_TEST_DIR) ; \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    83
	    $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    84
	    $(COMPONENT_TEST_CMD) \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    85
	    $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
6608
a98160718cfc 24363814 test-and-compare shouldn't redirect output to a file if the command is doing so
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
    86
	    $(if $(findstring $(COMPONENT_TEST_OUTPUT),$(COMPONENT_TEST_ENV)$(COMPONENT_TEST_ARGS)),,&> $(COMPONENT_TEST_OUTPUT))
5328
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    87
	$(COMPONENT_POST_TEST_ACTION)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    88
	$(COMPONENT_TEST_CREATE_TRANSFORMS)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    89
	$(COMPONENT_TEST_PERFORM_TRANSFORM)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    90
	$(COMPONENT_TEST_COMPARE)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    91
	$(COMPONENT_TEST_CLEANUP)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    92
	$(TOUCH) $@
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    93
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    94
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    95
$(BUILD_DIR)/%/.tested:    $(COMPONENT_TEST_DEP)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    96
	$(COMPONENT_PRE_TEST_ACTION)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    97
	(cd $(COMPONENT_TEST_DIR) ; \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    98
	    $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
    99
	    $(COMPONENT_TEST_CMD) \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   100
	    $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   101
	$(COMPONENT_POST_TEST_ACTION)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   102
	$(COMPONENT_TEST_CLEANUP)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   103
	$(TOUCH) $@
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   104
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   105
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   106
# Test the installed packages.  The targets above depend on .built which
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   107
# means $(CLONEY) has already run.  System-test needs cloning but not
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   108
# building; thus ideally, we would want to depend on .cloned here and below,
6608
a98160718cfc 24363814 test-and-compare shouldn't redirect output to a file if the command is doing so
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
   109
# but since we don't have that, we depend on .prep and run $(CLONEY) here.  If
a98160718cfc 24363814 test-and-compare shouldn't redirect output to a file if the command is doing so
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
   110
# the output file shows up in the environment or arguments, don't redirect
a98160718cfc 24363814 test-and-compare shouldn't redirect output to a file if the command is doing so
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
   111
# stdout/stderr to it.
5328
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   112
$(BUILD_DIR)/%/.system-tested-and-compared:    $(SOURCE_DIR)/.prep
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   113
	$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   114
	$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   115
	$(CLONEY) $(SOURCE_DIR) $(@D)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   116
	$(COMPONENT_PRE_SYSTEM_TEST_ACTION)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   117
	-(cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   118
	    $(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   119
	    $(COMPONENT_SYSTEM_TEST_CMD) \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   120
	    $(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS)) \
6608
a98160718cfc 24363814 test-and-compare shouldn't redirect output to a file if the command is doing so
Danek Duvall <danek.duvall@oracle.com>
parents: 5682
diff changeset
   121
	    $(if $(findstring $(COMPONENT_TEST_OUTPUT),$(COMPONENT_SYSTEM_TEST_ENV)$(COMPONENT_SYSTEM_TEST_ARGS)),,&> $(COMPONENT_TEST_OUTPUT))
5328
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   122
	$(COMPONENT_POST_SYSTEM_TEST_ACTION)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   123
	$(COMPONENT_TEST_CREATE_TRANSFORMS)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   124
	$(COMPONENT_TEST_PERFORM_TRANSFORM)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   125
	$(COMPONENT_TEST_COMPARE)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   126
	$(COMPONENT_SYSTEM_TEST_CLEANUP)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   127
	$(TOUCH) $@
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   128
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   129
$(BUILD_DIR)/%/.system-tested:    $(SOURCE_DIR)/.prep
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   130
	$(CLONEY) $(SOURCE_DIR) $(@D)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   131
	$(COMPONENT_PRE_SYSTEM_TEST_ACTION)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   132
	(cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   133
	    $(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   134
	    $(COMPONENT_SYSTEM_TEST_CMD) \
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   135
	    $(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS))
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   136
	$(COMPONENT_POST_SYSTEM_TEST_ACTION)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   137
	$(COMPONENT_SYSTEM_TEST_CLEANUP)
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   138
	$(TOUCH) $@
34fe0d5ec7b7 22585171 Need to add rules to gem.mk in Userland make-rules
Geoffrey Gardella <geoffrey.gardella@oracle.com>
parents: 4252
diff changeset
   139
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 2054
diff changeset
   140
REQUIRED_PACKAGES += runtime/ruby