python36: add libressl patch
[unleashed-userland.git] / make-rules / justmake.mk
blob9dc96a5947de883f153e2da3264088a50f1c26f1
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 $(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 ifeq ($(strip $(PARFAIT_BUILD)),yes)
65 -$(PARFAIT) build
66 endif
67 $(TOUCH) $@
69 COMPONENT_INSTALL_ACTION ?= \
70 cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
71 $(GMAKE) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS)
73 # install the built source into a prototype area
74 $(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
75 $(COMPONENT_PRE_INSTALL_ACTION)
76 ($(COMPONENT_INSTALL_ACTION))
77 $(COMPONENT_POST_INSTALL_ACTION)
78 $(TOUCH) $@
80 # test the built source
81 $(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
82 $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
83 $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
84 $(COMPONENT_PRE_TEST_ACTION)
85 -(cd $(COMPONENT_TEST_DIR) ; \
86 $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
87 $(COMPONENT_TEST_CMD) \
88 $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
89 &> $(COMPONENT_TEST_OUTPUT)
90 $(COMPONENT_POST_TEST_ACTION)
91 $(COMPONENT_TEST_CREATE_TRANSFORMS)
92 $(COMPONENT_TEST_PERFORM_TRANSFORM)
93 $(COMPONENT_TEST_COMPARE)
94 $(COMPONENT_TEST_CLEANUP)
95 $(TOUCH) $@
97 $(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
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 $(COMPONENT_POST_TEST_ACTION)
104 $(COMPONENT_TEST_CLEANUP)
105 $(TOUCH) $@
107 ifeq ($(strip $(PARFAIT_BUILD)),yes)
108 parfait: install
109 -$(PARFAIT) build
110 else
111 parfait:
112 $(MAKE) PARFAIT_BUILD=yes parfait
113 endif
115 clean::
116 $(RM) -r $(BUILD_DIR) $(PROTO_DIR)