author | Nobutomo Nakano <nobutomo.nakano@oracle.com> |
Fri, 16 Mar 2012 13:06:15 -0700 | |
branch | s11-sru |
changeset 2257 | 2dc4f82c8cdd |
parent 461 | edabdd6aff23 |
child 774 | d0cbca26a17c |
permissions | -rw-r--r-- |
2 | 1 |
# |
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 |
# |
|
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
42
diff
changeset
|
21 |
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. |
2 | 22 |
# |
23 |
||
34
d20b10eba317
prepare for zone based component builds
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
18
diff
changeset
|
24 |
UNPACK = $(WS_TOOLS)/userland-unpack |
d20b10eba317
prepare for zone based component builds
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
18
diff
changeset
|
25 |
FETCH = $(WS_TOOLS)/userland-fetch |
2 | 26 |
|
27 |
ARCHIVES += $(COMPONENT_ARCHIVE) |
|
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
42
diff
changeset
|
28 |
CLEAN_PATHS += $(SOURCE_DIR) |
2 | 29 |
|
198
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
30 |
# In order to override PATCH_DIR and PATCH_PATTERN in component makefiles, they |
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
31 |
# need to be conditionally set here. This means that the override needs to |
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
32 |
# happen prior to including prep.mk. Otherwise other variables set here which |
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
33 |
# are based on those will be expanded too early for the override to take effect. |
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
34 |
# You also can't override PATCHES after including prep.mk; if you want to |
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
35 |
# append filenames to PATCHES, you'll have to set $(EXTRA_PATCHES) prior to |
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
36 |
# inclusion. |
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
37 |
PATCH_DIR ?= patches |
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
38 |
PATCH_PATTERN ?= *.patch |
115
c360825c3a3f
7022166 userland patches should move to subdirs
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
59
diff
changeset
|
39 |
PATCHES = $(shell find $(PATCH_DIR) -type f -name '$(PATCH_PATTERN)' \ |
198
172fc01ce997
7016732 move vim from sfw to userland
Danek Duvall <danek.duvall@oracle.com>
parents:
142
diff
changeset
|
40 |
2>/dev/null | sort) $(EXTRA_PATCHES) |
115
c360825c3a3f
7022166 userland patches should move to subdirs
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
59
diff
changeset
|
41 |
STAMPS = $(PATCHES:$(PATCH_DIR)/%=$(SOURCE_DIR)/.%ed) |
2 | 42 |
|
115
c360825c3a3f
7022166 userland patches should move to subdirs
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
59
diff
changeset
|
43 |
$(SOURCE_DIR)/.%ed: $(PATCH_DIR)/% |
2 | 44 |
$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $< |
45 |
$(TOUCH) $@ |
|
46 |
||
142
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
47 |
# template for download rules. add new rules with $(call download-rule, suffix) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
48 |
define download-rule |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
49 |
ARCHIVES += $$(COMPONENT_ARCHIVE$(1)) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
50 |
CLOBBER_PATHS += $$(COMPONENT_ARCHIVE$(1)) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
51 |
$$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)): Makefile |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
52 |
$$(FETCH) --file $$@ \ |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
53 |
$$(COMPONENT_ARCHIVE_URL$(1):%=--url %) \ |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
54 |
$$(COMPONENT_ARCHIVE_HASH$(1):%=--hash %) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
55 |
$$(TOUCH) $$@ |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
56 |
endef |
2 | 57 |
|
142
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
58 |
# Generate the download rules from the above template |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
59 |
NUM_ARCHIVES = 1 2 3 4 5 6 7 |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
60 |
$(eval $(call download-rule,)) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
61 |
$(foreach suffix,$(NUM_ARCHIVES),$(eval $(call download-rule,_$(suffix)))) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
62 |
|
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
63 |
$(SOURCE_DIR)/.unpacked: download Makefile $(PATCHES) |
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
42
diff
changeset
|
64 |
$(RM) -r $(SOURCE_DIR) |
42
566ce4d2ff99
fix using/downloading shared archives
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
65 |
$(UNPACK) $(UNPACK_ARGS) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE) |
461
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
198
diff
changeset
|
66 |
$(COMPONENT_POST_UNPACK_ACTION) |
2 | 67 |
$(TOUCH) $@ |
68 |
||
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
42
diff
changeset
|
69 |
$(SOURCE_DIR)/.patched: $(SOURCE_DIR)/.unpacked $(STAMPS) |
2 | 70 |
$(TOUCH) $@ |
71 |
||
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
42
diff
changeset
|
72 |
$(SOURCE_DIR)/.prep: $(SOURCE_DIR)/.patched |
2 | 73 |
$(COMPONENT_PREP_ACTION) |
74 |
$(TOUCH) $@ |
|
75 |
||
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
42
diff
changeset
|
76 |
prep:: $(SOURCE_DIR)/.prep |
2 | 77 |
|
142
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
78 |
download:: $(ARCHIVES:%=$(USERLAND_ARCHIVES)%) |
9
97fb557d9979
lcms download link has changed
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
2
diff
changeset
|
79 |
|
2 | 80 |
clean:: |
81 |
$(RM) -r $(CLEAN_PATHS) |
|
82 |
||
83 |
clobber:: clean |
|
84 |
$(RM) -r $(CLOBBER_PATHS) |