commit | author | age
|
4f8cfa
|
1 |
# |
MS |
2 |
# CDDL HEADER START |
|
3 |
# |
|
4 |
# The contents of this file are subject to the terms of the |
|
5 |
# Common Development and Distribution License (the "License"). |
|
6 |
# You may not use this file except in compliance with the License. |
|
7 |
# |
|
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
# or http://www.opensolaris.org/os/licensing. |
|
10 |
# See the License for the specific language governing permissions |
|
11 |
# and limitations under the License. |
|
12 |
# |
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
# If applicable, add the following below this CDDL HEADER, with the |
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
# |
|
19 |
# CDDL HEADER END |
|
20 |
# |
702558
|
21 |
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
4f8cfa
|
22 |
# |
MS |
23 |
# |
|
24 |
# Rules and Macros for building opens source software that just uses their |
|
25 |
# own make and no autoconf-style tools. |
|
26 |
# |
|
27 |
# To use these rules, include ../make-rules/justmake.mk in your Makefile |
|
28 |
# and define "build", "install" targets appropriate to building your component. |
|
29 |
# Ex: |
|
30 |
# |
|
31 |
# build: $(BUILD_32) \ |
|
32 |
# $(BUILD_64) |
|
33 |
# |
|
34 |
# install: $(INSTALL_32) \ |
|
35 |
# $(INSTALL_64) |
|
36 |
# |
|
37 |
# Any additional pre/post configure, build, or install actions can be specified |
|
38 |
# in your Makefile by setting them in on of the following macros: |
|
39 |
# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION |
|
40 |
# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION |
|
41 |
# |
|
42 |
# If component specific make targets need to be used for build or install, they |
|
43 |
# can be specified in |
|
44 |
# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS |
|
45 |
# |
|
46 |
|
312c03
|
47 |
COMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR) |
22f774
|
48 |
COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS)) |
AL |
49 |
|
5597be
|
50 |
COMPONENT_COPY_ACTION ?= \ |
6feee0
|
51 |
$(ENV) $(CLONEY_ARGS) $(CLONEY) $(SOURCE_DIR) $(@D) |
5597be
|
52 |
|
22f774
|
53 |
COMPONENT_BUILD_ACTION ?= \ |
AL |
54 |
cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \ |
108756
|
55 |
$(GMAKE) $(COMPONENT_BUILD_GMAKE_ARGS) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS) |
312c03
|
56 |
|
4f8cfa
|
57 |
# build the configured source |
MS |
58 |
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep |
|
59 |
$(RM) -r $(@D) ; $(MKDIR) $(@D) |
5597be
|
60 |
$(COMPONENT_COPY_ACTION) |
4f8cfa
|
61 |
$(COMPONENT_PRE_BUILD_ACTION) |
22f774
|
62 |
($(COMPONENT_BUILD_ACTION)) |
4f8cfa
|
63 |
$(COMPONENT_POST_BUILD_ACTION) |
MS |
64 |
$(TOUCH) $@ |
|
65 |
|
22f774
|
66 |
COMPONENT_INSTALL_ACTION ?= \ |
AL |
67 |
cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \ |
|
68 |
$(GMAKE) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS) |
|
69 |
|
4f8cfa
|
70 |
# install the built source into a prototype area |
MS |
71 |
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built |
|
72 |
$(COMPONENT_PRE_INSTALL_ACTION) |
22f774
|
73 |
($(COMPONENT_INSTALL_ACTION)) |
4f8cfa
|
74 |
$(COMPONENT_POST_INSTALL_ACTION) |
MS |
75 |
$(TOUCH) $@ |
|
76 |
|
4158c0
|
77 |
# test the built source |
b6799e
|
78 |
$(BUILD_DIR)/%/.tested-and-compared: $(COMPONENT_TEST_DEP) |
237543
|
79 |
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR) |
AP |
80 |
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR) |
4158c0
|
81 |
$(COMPONENT_PRE_TEST_ACTION) |
8d70f8
|
82 |
-(cd $(COMPONENT_TEST_DIR) ; \ |
RB |
83 |
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \ |
|
84 |
$(COMPONENT_TEST_CMD) \ |
|
85 |
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \ |
|
86 |
&> $(COMPONENT_TEST_OUTPUT) |
|
87 |
$(COMPONENT_POST_TEST_ACTION) |
|
88 |
$(COMPONENT_TEST_CREATE_TRANSFORMS) |
|
89 |
$(COMPONENT_TEST_PERFORM_TRANSFORM) |
|
90 |
$(COMPONENT_TEST_COMPARE) |
|
91 |
$(COMPONENT_TEST_CLEANUP) |
|
92 |
$(TOUCH) $@ |
|
93 |
|
89aae0
|
94 |
$(BUILD_DIR)/%/.tested: SHELLOPTS=pipefail |
b6799e
|
95 |
$(BUILD_DIR)/%/.tested: $(COMPONENT_TEST_DEP) |
89aae0
|
96 |
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR) |
MT |
97 |
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR) |
8d70f8
|
98 |
$(COMPONENT_PRE_TEST_ACTION) |
RB |
99 |
(cd $(COMPONENT_TEST_DIR) ; \ |
|
100 |
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \ |
|
101 |
$(COMPONENT_TEST_CMD) \ |
89aae0
|
102 |
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \ |
MT |
103 |
|& $(TEE) $(COMPONENT_TEST_OUTPUT) |
4158c0
|
104 |
$(COMPONENT_POST_TEST_ACTION) |
89aae0
|
105 |
$(COMPONENT_TEST_CREATE_TRANSFORMS) |
MT |
106 |
$(COMPONENT_TEST_PERFORM_TRANSFORM) |
8d70f8
|
107 |
$(COMPONENT_TEST_CLEANUP) |
4158c0
|
108 |
$(TOUCH) $@ |
7999b2
|
109 |
|
4f8cfa
|
110 |
clean:: |
MS |
111 |
$(RM) -r $(BUILD_DIR) $(PROTO_DIR) |