author | Lukas Rovensky <Lukas.Rovensky@oracle.com> |
Tue, 05 Apr 2011 05:36:00 -0700 | |
changeset 168 | 5884bc1edfdf |
parent 142 | 6f1cb90a0ef3 |
child 198 | 172fc01ce997 |
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 |
|
115
c360825c3a3f
7022166 userland patches should move to subdirs
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
59
diff
changeset
|
30 |
PATCH_DIR = patches |
c360825c3a3f
7022166 userland patches should move to subdirs
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
59
diff
changeset
|
31 |
PATCH_PATTERN = *.patch |
c360825c3a3f
7022166 userland patches should move to subdirs
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
59
diff
changeset
|
32 |
PATCHES = $(shell find $(PATCH_DIR) -type f -name '$(PATCH_PATTERN)' \ |
c360825c3a3f
7022166 userland patches should move to subdirs
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
59
diff
changeset
|
33 |
2>/dev/null | sort) |
c360825c3a3f
7022166 userland patches should move to subdirs
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
59
diff
changeset
|
34 |
STAMPS = $(PATCHES:$(PATCH_DIR)/%=$(SOURCE_DIR)/.%ed) |
2 | 35 |
|
115
c360825c3a3f
7022166 userland patches should move to subdirs
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
59
diff
changeset
|
36 |
$(SOURCE_DIR)/.%ed: $(PATCH_DIR)/% |
2 | 37 |
$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $< |
38 |
$(TOUCH) $@ |
|
39 |
||
142
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
40 |
# 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
|
41 |
define download-rule |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
42 |
ARCHIVES += $$(COMPONENT_ARCHIVE$(1)) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
43 |
CLOBBER_PATHS += $$(COMPONENT_ARCHIVE$(1)) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
44 |
$$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)): Makefile |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
45 |
$$(FETCH) --file $$@ \ |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
46 |
$$(COMPONENT_ARCHIVE_URL$(1):%=--url %) \ |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
47 |
$$(COMPONENT_ARCHIVE_HASH$(1):%=--hash %) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
48 |
$$(TOUCH) $$@ |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
49 |
endef |
2 | 50 |
|
142
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
51 |
# Generate the download rules from the above template |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
52 |
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
|
53 |
$(eval $(call download-rule,)) |
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
54 |
$(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
|
55 |
|
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
56 |
$(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
|
57 |
$(RM) -r $(SOURCE_DIR) |
42
566ce4d2ff99
fix using/downloading shared archives
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
58 |
$(UNPACK) $(UNPACK_ARGS) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE) |
2 | 59 |
$(TOUCH) $@ |
60 |
||
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
|
61 |
$(SOURCE_DIR)/.patched: $(SOURCE_DIR)/.unpacked $(STAMPS) |
2 | 62 |
$(TOUCH) $@ |
63 |
||
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 |
$(SOURCE_DIR)/.prep: $(SOURCE_DIR)/.patched |
2 | 65 |
$(COMPONENT_PREP_ACTION) |
66 |
$(TOUCH) $@ |
|
67 |
||
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
|
68 |
prep:: $(SOURCE_DIR)/.prep |
2 | 69 |
|
142
6f1cb90a0ef3
7026996 move tomcat to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
115
diff
changeset
|
70 |
download:: $(ARCHIVES:%=$(USERLAND_ARCHIVES)%) |
9
97fb557d9979
lcms download link has changed
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
2
diff
changeset
|
71 |
|
2 | 72 |
clean:: |
73 |
$(RM) -r $(CLEAN_PATHS) |
|
74 |
||
75 |
clobber:: clean |
|
76 |
$(RM) -r $(CLOBBER_PATHS) |