illumos-closed: add graphic drivers: m64, gfxp and zulu, delete tsalarm and aes modul...
[oi-userland.git] / make-rules / justmake.mk
blobdd662896e3e7f2c4ddee9b6cb1b1a496da5f092f
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_COPY_ACTION ?= \
51 $(ENV) $(CLONEY_ARGS) $(CLONEY) $(SOURCE_DIR) $(@D)
53 COMPONENT_BUILD_ACTION ?= \
54 cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \
55 $(GMAKE) $(COMPONENT_BUILD_GMAKE_ARGS) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS)
57 # build the configured source
58 $(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
59 $(RM) -r $(@D) ; $(MKDIR) $(@D)
60 $(COMPONENT_COPY_ACTION)
61 $(COMPONENT_PRE_BUILD_ACTION)
62 ($(COMPONENT_BUILD_ACTION))
63 $(COMPONENT_POST_BUILD_ACTION)
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: $(COMPONENT_TEST_DEP)
79 $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
80 $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
81 $(COMPONENT_PRE_TEST_ACTION)
82 -(cd $(COMPONENT_TEST_DIR) ; \
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) $@
94 $(BUILD_DIR)/%/.tested: SHELLOPTS=pipefail
95 $(BUILD_DIR)/%/.tested: $(COMPONENT_TEST_DEP)
96 $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
97 $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
98 $(COMPONENT_PRE_TEST_ACTION)
99 (cd $(COMPONENT_TEST_DIR) ; \
100 $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
101 $(COMPONENT_TEST_CMD) \
102 $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
103 |& $(TEE) $(COMPONENT_TEST_OUTPUT)
104 $(COMPONENT_POST_TEST_ACTION)
105 $(COMPONENT_TEST_CREATE_TRANSFORMS)
106 $(COMPONENT_TEST_PERFORM_TRANSFORM)
107 $(COMPONENT_TEST_CLEANUP)
108 $(TOUCH) $@
110 clean::
111 $(RM) -r $(BUILD_DIR) $(PROTO_DIR)