REQ xdm
[unleashed-userland.git] / make-rules / justmake.mk
blobf9678df10ae5bbbdbac34e41890ac76e0619773b
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
21 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
24 # Rules and Macros for building opens source software that just uses their
25 # own make and no autoconf-style tools.
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:
31 # build: $(BUILD_32) \
32 # $(BUILD_64)
34 # install: $(INSTALL_32) \
35 # $(INSTALL_64)
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
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
47 COMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
48 COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
50 COMPONENT_BUILD_ACTION ?= \
51 cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \
52 $(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS)
54 # build the configured source
55 $(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
56 $(RM) -r $(@D) ; $(MKDIR) $(@D)
57 $(CLONEY) $(SOURCE_DIR) $(@D)
58 $(COMPONENT_PRE_BUILD_ACTION)
59 ($(COMPONENT_BUILD_ACTION))
60 $(COMPONENT_POST_BUILD_ACTION)
61 ifeq ($(strip $(PARFAIT_BUILD)),yes)
62 -$(PARFAIT) build
63 endif
64 $(TOUCH) $@
66 COMPONENT_INSTALL_ACTION ?= \
67 cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
68 $(GMAKE) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS)
70 # install the built source into a prototype area
71 $(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
72 $(COMPONENT_PRE_INSTALL_ACTION)
73 ($(COMPONENT_INSTALL_ACTION))
74 $(COMPONENT_POST_INSTALL_ACTION)
75 $(TOUCH) $@
77 # test the built source
78 $(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
79 $(COMPONENT_PRE_TEST_ACTION)
80 -(cd $(COMPONENT_TEST_DIR) ; \
81 $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
82 $(COMPONENT_TEST_CMD) \
83 $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
84 &> $(COMPONENT_TEST_OUTPUT)
85 $(COMPONENT_POST_TEST_ACTION)
86 $(COMPONENT_TEST_CREATE_TRANSFORMS)
87 $(COMPONENT_TEST_PERFORM_TRANSFORM)
88 $(COMPONENT_TEST_COMPARE)
89 $(COMPONENT_TEST_CLEANUP)
90 $(TOUCH) $@
92 $(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
93 $(COMPONENT_PRE_TEST_ACTION)
94 (cd $(COMPONENT_TEST_DIR) ; \
95 $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
96 $(COMPONENT_TEST_CMD) \
97 $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
98 $(COMPONENT_POST_TEST_ACTION)
99 $(COMPONENT_TEST_CLEANUP)
100 $(TOUCH) $@
102 ifeq ($(strip $(PARFAIT_BUILD)),yes)
103 parfait: install
104 -$(PARFAIT) build
105 else
106 parfait:
107 $(MAKE) PARFAIT_BUILD=yes parfait
108 endif
110 clean::
111 $(RM) -r $(BUILD_DIR) $(PROTO_DIR)