Merge pull request #2551 from pyhalov/mod_perl
[unleashed-userland.git] / make-rules / justmake.mk
blob4027272bc8bac0293af2ab56ee4b2012451285ee
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_GMAKE_ARGS) $(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 $(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: $(BUILD_DIR)/%/.built
95 $(COMPONENT_PRE_TEST_ACTION)
96 (cd $(COMPONENT_TEST_DIR) ; \
97 $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
98 $(COMPONENT_TEST_CMD) \
99 $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
100 $(COMPONENT_POST_TEST_ACTION)
101 $(COMPONENT_TEST_CLEANUP)
102 $(TOUCH) $@
104 ifeq ($(strip $(PARFAIT_BUILD)),yes)
105 parfait: install
106 -$(PARFAIT) build
107 else
108 parfait:
109 $(MAKE) PARFAIT_BUILD=yes parfait
110 endif
112 clean::
113 $(RM) -r $(BUILD_DIR) $(PROTO_DIR)