justmake.mk revision 4089
0N/A#
0N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License (the "License").
0N/A# You may not use this file except in compliance with the License.
0N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
0N/A# information: Portions Copyright [yyyy] [name of copyright owner]
0N/A#
873N/A# CDDL HEADER END
0N/A#
0N/A# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
0N/A#
0N/A#
0N/A# Rules and Macros for building opens source software that just uses their
5031N/A# own make and no autoconf-style tools.
5381N/A#
0N/A# To use these rules, include $(WS_MAKE_RULES)/justmake.mk in your Makefile
1183N/A# and define "build", "install" targets appropriate to building your component.
2426N/A# Ex:
1280N/A#
2426N/A# build: $(BUILD_32) \
2426N/A# $(BUILD_64)
2426N/A#
734N/A# install: $(INSTALL_32) \
734N/A# $(INSTALL_64)
734N/A#
734N/A# Any additional pre/post configure, build, or install actions can be specified
2426N/A# in your Makefile by setting them in on of the following macros:
734N/A# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
734N/A# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
734N/A#
734N/A# If component specific make targets need to be used for build or install, they
734N/A# can be specified in
5347N/A# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
0N/A#
4501N/A
2426N/ACOMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
2426N/A
4501N/A# build the configured source
1162N/A$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
4841N/A $(RM) -r $(@D) ; $(MKDIR) $(@D)
4841N/A $(CLONEY) $(SOURCE_DIR) $(@D)
1204N/A $(COMPONENT_PRE_BUILD_ACTION)
4841N/A (cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
2426N/A $(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
2426N/A $(COMPONENT_POST_BUILD_ACTION)
2426N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
2426N/A -$(PARFAIT) $(@D)
2426N/Aendif
4841N/A $(TOUCH) $@
0N/A
1586N/A# install the built source into a prototype area
4501N/A$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
4501N/A $(COMPONENT_PRE_INSTALL_ACTION)
2426N/A (cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
4841N/A $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
2426N/A $(COMPONENT_POST_INSTALL_ACTION)
4501N/A $(TOUCH) $@
2270N/A
4501N/A# test the built source
4501N/A$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
4501N/A $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
4501N/A $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
4554N/A $(COMPONENT_PRE_TEST_ACTION)
4841N/A -(cd $(COMPONENT_TEST_DIR) ; \
2426N/A $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
0N/A $(COMPONENT_TEST_CMD) \
0N/A $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
4501N/A &> $(COMPONENT_TEST_OUTPUT)
4411N/A $(COMPONENT_POST_TEST_ACTION)
2426N/A $(COMPONENT_TEST_CREATE_TRANSFORMS)
2426N/A $(COMPONENT_TEST_PERFORM_TRANSFORM)
2426N/A $(COMPONENT_TEST_COMPARE)
2426N/A $(COMPONENT_TEST_CLEANUP)
1162N/A $(TOUCH) $@
4841N/A
4841N/A$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
2426N/A $(COMPONENT_PRE_TEST_ACTION)
4501N/A (cd $(COMPONENT_TEST_DIR) ; \
4411N/A $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
4501N/A $(COMPONENT_TEST_CMD) \
0N/A $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
734N/A $(COMPONENT_POST_TEST_ACTION)
5357N/A $(COMPONENT_TEST_CLEANUP)
0N/A $(TOUCH) $@
0N/A
1191N/A# test the installed packages
0N/A$(BUILD_DIR)/%/.system-tested-and-compared: $(SOURCE_DIR)/.prep
1191N/A $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
0N/A $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
0N/A $(COMPONENT_PRE_SYSTEM_TEST_ACTION)
1191N/A -(cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
0N/A $(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
2929N/A $(COMPONENT_SYSTEM_TEST_CMD) \
2929N/A $(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS)) \
0N/A &> $(COMPONENT_TEST_OUTPUT)
5347N/A $(COMPONENT_POST_SYSTEM_TEST_ACTION)
4224N/A $(COMPONENT_TEST_CREATE_TRANSFORMS)
2426N/A $(COMPONENT_TEST_PERFORM_TRANSFORM)
2426N/A $(COMPONENT_TEST_COMPARE)
0N/A $(COMPONENT_SYSTEM_TEST_CLEANUP)
4802N/A $(TOUCH) $@
535N/A
0N/A$(BUILD_DIR)/%/.system-tested: $(SOURCE_DIR)/.prep
535N/A $(COMPONENT_PRE_SYSTEM_TEST_ACTION)
2184N/A (cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
2184N/A $(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
0N/A $(COMPONENT_SYSTEM_TEST_CMD) \
1191N/A $(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS))
1191N/A $(COMPONENT_POST_SYSTEM_TEST_ACTION)
0N/A $(COMPONENT_SYSTEM_TEST_CLEANUP)
0N/A $(TOUCH) $@
0N/A
0N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
5347N/Aparfait: build
5347N/Aelse
0N/Aparfait:
0N/A $(MAKE) PARFAIT_BUILD=yes parfait
5337N/Aendif
1191N/A
535N/Aclean::
560N/A $(RM) -r $(BUILD_DIR) $(PROTO_DIR)
734N/A