1 #
2 # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
86 endif
87 ifneq ($$($1_SOURCE_BASE_DIR),)
88 $$(error Cannot use SOURCE_BASE_DIR without SOURCE_DIRS (in $1))
89 endif
90 ifneq ($$($1_EXCLUDE_FILES)$$($1_INCLUDE_FILES),)
91 $$(error Cannot INCLUDE/EXCLUDE_FILES with SOURCE_FILES (in $1))
92 endif
93 else
94 ifeq ($$($1_SOURCE_DIRS),)
95 $$(error Must specify either SOURCE_FILES or SOURCE_DIRS (in $1))
96 endif
97 # Find all files in the source trees. Sort to remove duplicates.
98 $$(foreach src, $$($1_SOURCE_DIRS), $$(if $$(wildcard $$(src)), , \
99 $$(error SOURCE_DIRS contains missing directory $$(src) (in $1))))
100 ifneq ($$($1_SOURCE_BASE_DIR),)
101 $$(foreach src, $$($1_SOURCE_DIRS), \
102 $$(if $$(findstring $$($1_SOURCE_BASE_DIR), $$(src)), , \
103 $$(error SOURCE_DIRS contains directory $$(src) outside \
104 SOURCE_BASE_DIR $$($1_SOURCE_BASE_DIR) (in $1))))
105 endif
106 $1_SOURCE_FILES := $$(sort $$(call CacheFind,$$($1_SOURCE_DIRS)))
107 $1_EXCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
108 $1_INCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
109 $1_SOURCE_FILES := $$(filter-out $$($1_EXCLUDE_FILES),$$($1_SOURCE_FILES))
110 ifneq (,$$(strip $$($1_INCLUDE_FILES)))
111 $1_SOURCE_FILES := $$(filter $$($1_INCLUDE_FILES),$$($1_SOURCE_FILES))
112 endif
113 ifeq (,$$($1_SOURCE_FILES))
114 $$(info No sources found for $1 when looking inside the dirs $$($1_SRC))
115 endif
116 endif
117
118 ifneq ($$($1_REPLACEMENTS),)
119 # We have a replacement request, prepare it for the recipe
120 ifneq ($$(findstring /,$$($1_REPLACEMENTS)),)
121 # Cannot use / as separator
122 ifneq ($$(findstring @,$$($1_REPLACEMENTS)),)
123 # Cannot use @ as separator
124 ifneq ($$(findstring |,$$($1_REPLACEMENTS)),)
125 # Cannot use | as separator
126 ifneq ($$(findstring !,$$($1_REPLACEMENTS)),)
|
1 #
2 # Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
86 endif
87 ifneq ($$($1_SOURCE_BASE_DIR),)
88 $$(error Cannot use SOURCE_BASE_DIR without SOURCE_DIRS (in $1))
89 endif
90 ifneq ($$($1_EXCLUDE_FILES)$$($1_INCLUDE_FILES),)
91 $$(error Cannot INCLUDE/EXCLUDE_FILES with SOURCE_FILES (in $1))
92 endif
93 else
94 ifeq ($$($1_SOURCE_DIRS),)
95 $$(error Must specify either SOURCE_FILES or SOURCE_DIRS (in $1))
96 endif
97 # Find all files in the source trees. Sort to remove duplicates.
98 $$(foreach src, $$($1_SOURCE_DIRS), $$(if $$(wildcard $$(src)), , \
99 $$(error SOURCE_DIRS contains missing directory $$(src) (in $1))))
100 ifneq ($$($1_SOURCE_BASE_DIR),)
101 $$(foreach src, $$($1_SOURCE_DIRS), \
102 $$(if $$(findstring $$($1_SOURCE_BASE_DIR), $$(src)), , \
103 $$(error SOURCE_DIRS contains directory $$(src) outside \
104 SOURCE_BASE_DIR $$($1_SOURCE_BASE_DIR) (in $1))))
105 endif
106 $1_SOURCE_FILES := $$(sort $$(call FindFiles,$$($1_SOURCE_DIRS)))
107 $1_EXCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
108 $1_INCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
109 $1_SOURCE_FILES := $$(filter-out $$($1_EXCLUDE_FILES),$$($1_SOURCE_FILES))
110 ifneq (,$$(strip $$($1_INCLUDE_FILES)))
111 $1_SOURCE_FILES := $$(filter $$($1_INCLUDE_FILES),$$($1_SOURCE_FILES))
112 endif
113 ifeq (,$$($1_SOURCE_FILES))
114 $$(info No sources found for $1 when looking inside the dirs $$($1_SRC))
115 endif
116 endif
117
118 ifneq ($$($1_REPLACEMENTS),)
119 # We have a replacement request, prepare it for the recipe
120 ifneq ($$(findstring /,$$($1_REPLACEMENTS)),)
121 # Cannot use / as separator
122 ifneq ($$(findstring @,$$($1_REPLACEMENTS)),)
123 # Cannot use @ as separator
124 ifneq ($$(findstring |,$$($1_REPLACEMENTS)),)
125 # Cannot use | as separator
126 ifneq ($$(findstring !,$$($1_REPLACEMENTS)),)
|