< prev index next >

make/common/JavaCompilation.gmk

Print this page


   1 #
   2 # Copyright (c) 2011, 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


 205     $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
 206   endif
 207   $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
 208   $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
 209   $1_DISABLE_SJAVAC := $$($$($1_SETUP)_DISABLE_SJAVAC)
 210 
 211   ifneq ($$($1_MODULE), )
 212     $1_MODULE_SUBDIR := /$$($1_MODULE)
 213   endif
 214 
 215   # Make sure the dirs exist, or that one of the EXTRA_FILES, that may not
 216   # exist yet, is in it.
 217   $$(foreach d, $$($1_SRC), \
 218     $$(if $$(wildcard $$d), , \
 219       $$(if $$(filter $$d%, $$($1_EXTRA_FILES)), , \
 220         $$(error SRC specified to SetupJavaCompilation $1 contains missing directory >$$d<) \
 221       ) \
 222     ) \
 223   )
 224   $$(call MakeDir,$$($1_BIN))
 225   # Order src files according to the order of the src dirs. Correct odering is
 226   # needed for correct overriding between different source roots.
 227   $1_ALL_SRC_RAW := $$(call FindFiles, $$($1_SRC))
 228   $1_ALL_SRCS := $$($1_EXTRA_FILES) \
 229       $$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_ALL_SRC_RAW)))
 230 

 231   # Extract the java files.
 232   $1_SRCS := $$(filter %.java, $$($1_ALL_SRCS))
 233 
 234   # Translate include/exclude into patterns
 235   ifneq ($$($1_EXCLUDE_FILES), )
 236     $1_EXCLUDE_PATTERN := $$(addprefix %, $$($1_EXCLUDE_FILES))
 237   endif
 238   ifneq ($$($1_INCLUDE_FILES), )
 239     $1_INCLUDE_PATTERN := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_INCLUDE_FILES)))
 240   endif
 241   ifneq ($$($1_EXCLUDES), )
 242     $1_EXCLUDE_PATTERN += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_EXCLUDES))))
 243   endif
 244   ifneq ($$($1_INCLUDES), )
 245     $1_INCLUDE_PATTERN += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_INCLUDES))))
 246   endif
 247 
 248   # Apply include/exclude patterns to java sources
 249   ifneq ($$($1_EXCLUDE_PATTERN), )
 250     $1_SRCS := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_SRCS))


   1 #
   2 # Copyright (c) 2011, 2018, 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


 205     $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
 206   endif
 207   $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
 208   $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
 209   $1_DISABLE_SJAVAC := $$($$($1_SETUP)_DISABLE_SJAVAC)
 210 
 211   ifneq ($$($1_MODULE), )
 212     $1_MODULE_SUBDIR := /$$($1_MODULE)
 213   endif
 214 
 215   # Make sure the dirs exist, or that one of the EXTRA_FILES, that may not
 216   # exist yet, is in it.
 217   $$(foreach d, $$($1_SRC), \
 218     $$(if $$(wildcard $$d), , \
 219       $$(if $$(filter $$d%, $$($1_EXTRA_FILES)), , \
 220         $$(error SRC specified to SetupJavaCompilation $1 contains missing directory >$$d<) \
 221       ) \
 222     ) \
 223   )
 224   $$(call MakeDir,$$($1_BIN))
 225   # Add all source roots to the find cache since we are likely going to run find
 226   # on these more than once. The cache will only be updated if necessary.
 227   $$(eval $$(call FillCacheFind, $$($1_SRC)))
 228   # Find all files in the source trees. Preserve order of source roots so that
 229   # the first version in case of multiple instances of the same file is selected.
 230   # CacheFind does not preserve order so need to call it for each root.
 231   $1_ALL_SRCS += $$($1_EXTRA_FILES) $$(foreach s, $$($1_SRC), $$(call CacheFind, $$s))
 232   # Extract the java files.
 233   $1_SRCS := $$(filter %.java, $$($1_ALL_SRCS))
 234 
 235   # Translate include/exclude into patterns
 236   ifneq ($$($1_EXCLUDE_FILES), )
 237     $1_EXCLUDE_PATTERN := $$(addprefix %, $$($1_EXCLUDE_FILES))
 238   endif
 239   ifneq ($$($1_INCLUDE_FILES), )
 240     $1_INCLUDE_PATTERN := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_INCLUDE_FILES)))
 241   endif
 242   ifneq ($$($1_EXCLUDES), )
 243     $1_EXCLUDE_PATTERN += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_EXCLUDES))))
 244   endif
 245   ifneq ($$($1_INCLUDES), )
 246     $1_INCLUDE_PATTERN += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_INCLUDES))))
 247   endif
 248 
 249   # Apply include/exclude patterns to java sources
 250   ifneq ($$($1_EXCLUDE_PATTERN), )
 251     $1_SRCS := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_SRCS))


< prev index next >