make-rules/justmake.mk
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Thu, 20 Jan 2011 14:23:47 -0800
changeset 61 7684fe2a9eb5
child 94 e2364cad23ff
permissions -rw-r--r--
7011958 some things lost during move to userland 7013316 move bzip2 to userland
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
61
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     1
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     2
# CDDL HEADER START
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     3
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     7
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    11
# and limitations under the License.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    12
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    18
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    19
# CDDL HEADER END
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    20
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    21
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    22
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    23
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    24
# Rules and Macros for building opens source software that just uses their
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    25
# own make and no autoconf-style tools.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    26
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    27
# To use these rules, include ../make-rules/justmake.mk in your Makefile
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    28
# and define "build", "install" targets appropriate to building your component.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    29
# Ex:
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    30
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    31
# 	build:		$(BUILD_32) \
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    32
#	 		$(BUILD_64)
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    33
# 
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    34
#	install:	$(INSTALL_32) \
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    35
#	 		$(INSTALL_64)
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    36
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    37
# Any additional pre/post configure, build, or install actions can be specified
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    38
# in your Makefile by setting them in on of the following macros:
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    39
#	COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    40
#	COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    41
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    42
# If component specific make targets need to be used for build or install, they
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    43
# can be specified in
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    44
#	COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    45
#
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    46
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    47
CLONEY =	$(WS_TOOLS)/cloney
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    48
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    49
$(BUILD_DIR_32)/.built:	BITS=32
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    50
$(BUILD_DIR_64)/.built:	BITS=64
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    51
$(BUILD_DIR_32)/.install:	BITS=32
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    52
$(BUILD_DIR_64)/.install:	BITS=64
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    53
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    54
# set the default target for installation of the component
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    55
COMPONENT_INSTALL_TARGETS =	install
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    56
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    57
# build the configured source
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    58
$(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    59
	$(RM) -r $(@D) ; $(MKDIR) $(@D)
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    60
	$(CLONEY) $(SOURCE_DIR) $(@D)
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    61
	$(COMPONENT_PRE_BUILD_ACTION)
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    62
	(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    63
		$(GMAKE) $(COMPONENT_BUILD_TARGETS))
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    64
	$(COMPONENT_POST_BUILD_ACTION)
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    65
	$(TOUCH) [email protected]
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    66
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    67
# install the built source into a prototype area
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    68
$(BUILD_DIR)/%/.installed:	$(BUILD_DIR)/%/.built
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    69
	$(COMPONENT_PRE_INSTALL_ACTION)
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    70
	(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    71
			$(COMPONENT_INSTALL_TARGETS))
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    72
	$(COMPONENT_POST_INSTALL_ACTION)
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    73
	$(TOUCH) [email protected]
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    74
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    75
clean::
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    76
	$(RM) -r $(BUILD_DIR) $(PROTO_DIR)