< prev index next >

make/common/JarArchive.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


 107           $$(eval $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS, \
 108               $$($1_BIN)/_the.$$($1_JARNAME)_exclude))
 109       $1_GREP_EXCLUDES:=| ( $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude \
 110           || test "$$$$?" = "1" )
 111     endif
 112   endif
 113 
 114   # Check if this jar needs to have its index generated.
 115   ifneq (,$$($1_JARINDEX))
 116     $1_JARINDEX = (cd $$(dir $$@) && $$($1_JAR_CMD) -i $$(notdir $$@))
 117   else
 118     $1_JARINDEX = true
 119   endif
 120   # When this macro is run in the same makefile as the java compilation, dependencies are
 121   # transfered in make variables. When the macro is run in a different makefile than the
 122   # java compilation, the dependencies need to be found in the filesystem.
 123   $1_ORIG_DEPS := $$($1_DEPENDENCIES)
 124   ifeq ($$($1_DEPENDENCIES), )
 125     # Add all source roots to the find cache since we are likely going to run find
 126     # on these more than once. The cache will only be updated if necessary.
 127     $$(call FillFindCache, $$($1_FIND_LIST))
 128     $1_DEPENDENCIES:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
 129         $$(call FindFiles,$$($1_SRCS)))
 130     ifneq (,$$($1_GREP_INCLUDE_PATTERNS))
 131       $1_DEPENDENCIES:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
 132     endif
 133     ifneq (,$$($1_GREP_EXCLUDE_PATTERNS))
 134       $1_DEPENDENCIES:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
 135     endif
 136     # Look for EXTRA_FILES in all SRCS dirs and as absolute paths.
 137     $1_DEPENDENCIES+=$$(wildcard $$(foreach src, $$($1_SRCS), \
 138         $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES))
 139     ifeq (,$$($1_SKIP_METAINF))
 140       $1_DEPENDENCIES+=$$(call FindFiles,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
 141     endif
 142   endif
 143   # The dependency list should never be empty
 144   ifeq ($$(strip $$($1_DEPENDENCIES)), )
 145     $$(warning No dependencies found for $1)
 146   endif
 147 
 148   # Utility macros, to make the shell script receipt somewhat easier to decipher.
 149 
 150   # Capture extra files is the same for both CAPTURE_CONTENTS and SCAPTURE_CONTENTS so
 151   # only define it once to avoid duplication.
 152   # The list of extra files might be long, so need to use ListPathsSafely to print
 153   # them out to a separte file. Then process the contents of that file to rewrite
 154   # into -C <dir> <file> lines.
 155   # The EXTRA_FILES_RESOLVED varible must be set in the macro so that it's evaluated
 156   # in the recipe when the files are guaranteed to exist.
 157   $1_CAPTURE_EXTRA_FILES=\
 158       $$(eval $1_EXTRA_FILES_RESOLVED:=$$(call DoubleDollar, \
 159           $$(wildcard $$(foreach src, $$($1_SRCS), \
 160           $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES)))) \


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


 107           $$(eval $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS, \
 108               $$($1_BIN)/_the.$$($1_JARNAME)_exclude))
 109       $1_GREP_EXCLUDES:=| ( $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude \
 110           || test "$$$$?" = "1" )
 111     endif
 112   endif
 113 
 114   # Check if this jar needs to have its index generated.
 115   ifneq (,$$($1_JARINDEX))
 116     $1_JARINDEX = (cd $$(dir $$@) && $$($1_JAR_CMD) -i $$(notdir $$@))
 117   else
 118     $1_JARINDEX = true
 119   endif
 120   # When this macro is run in the same makefile as the java compilation, dependencies are
 121   # transfered in make variables. When the macro is run in a different makefile than the
 122   # java compilation, the dependencies need to be found in the filesystem.
 123   $1_ORIG_DEPS := $$($1_DEPENDENCIES)
 124   ifeq ($$($1_DEPENDENCIES), )
 125     # Add all source roots to the find cache since we are likely going to run find
 126     # on these more than once. The cache will only be updated if necessary.
 127     $$(eval $$(call FillCacheFind, $$($1_FIND_LIST)))
 128     $1_DEPENDENCIES:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
 129         $$(call CacheFind,$$($1_SRCS)))
 130     ifneq (,$$($1_GREP_INCLUDE_PATTERNS))
 131       $1_DEPENDENCIES:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
 132     endif
 133     ifneq (,$$($1_GREP_EXCLUDE_PATTERNS))
 134       $1_DEPENDENCIES:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
 135     endif
 136     # Look for EXTRA_FILES in all SRCS dirs and as absolute paths.
 137     $1_DEPENDENCIES+=$$(wildcard $$(foreach src, $$($1_SRCS), \
 138         $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES))
 139     ifeq (,$$($1_SKIP_METAINF))
 140       $1_DEPENDENCIES+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
 141     endif
 142   endif
 143   # The dependency list should never be empty
 144   ifeq ($$(strip $$($1_DEPENDENCIES)), )
 145     $$(warning No dependencies found for $1)
 146   endif
 147 
 148   # Utility macros, to make the shell script receipt somewhat easier to decipher.
 149 
 150   # Capture extra files is the same for both CAPTURE_CONTENTS and SCAPTURE_CONTENTS so
 151   # only define it once to avoid duplication.
 152   # The list of extra files might be long, so need to use ListPathsSafely to print
 153   # them out to a separte file. Then process the contents of that file to rewrite
 154   # into -C <dir> <file> lines.
 155   # The EXTRA_FILES_RESOLVED varible must be set in the macro so that it's evaluated
 156   # in the recipe when the files are guaranteed to exist.
 157   $1_CAPTURE_EXTRA_FILES=\
 158       $$(eval $1_EXTRA_FILES_RESOLVED:=$$(call DoubleDollar, \
 159           $$(wildcard $$(foreach src, $$($1_SRCS), \
 160           $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES)))) \


< prev index next >