common/makefiles/JavaCompilation.gmk
changeset 18422 8443ba629f9d
parent 16583 f29d60d73e42
child 20273 126644dde85d
child 22466 25aaf85d1ada
equal deleted inserted replaced
18421:0296625b6c1f 18422:8443ba629f9d
   153         endif
   153         endif
   154         # The subst of \ is needed because $ has to be escaped with \ in EXTRA_FILES for the command 
   154         # The subst of \ is needed because $ has to be escaped with \ in EXTRA_FILES for the command 
   155         # lines, but not here for use in make dependencies.
   155         # lines, but not here for use in make dependencies.
   156         $1_DEPS+=$$(subst \,,$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,$$($1_EXTRA_FILES))))
   156         $1_DEPS+=$$(subst \,,$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,$$($1_EXTRA_FILES))))
   157         ifeq (,$$($1_SKIP_METAINF))
   157         ifeq (,$$($1_SKIP_METAINF))
   158             $1_DEPS+=$$(call CacheFind $$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
   158             $1_DEPS+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
   159         endif
   159         endif
   160     endif
   160     endif
   161 
   161 
   162     # Utility macros, to make the shell script receipt somewhat easier to dechipher.
   162     # Utility macros, to make the shell script receipt somewhat easier to dechipher.
   163 
   163 
   253     #    SRC,ZIP,INCLUDES,INCLUDE_FILES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS
   253     #    SRC,ZIP,INCLUDES,INCLUDE_FILES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS
   254     $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
   254     $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
   255     $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
   255     $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
   256     $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk))
   256     $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk))
   257 
   257 
       
   258     # To avoid running find over too large sets of files, which causes make to crash
       
   259     # on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set
       
   260     # of directories to run find in, if available.
       
   261     ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),)
       
   262 	$1_FIND_LIST := $$(wildcard $$(foreach i,$$($1_SRC),\
       
   263 		$$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES))))
       
   264     else
       
   265         $1_FIND_LIST := $$($1_SRC)
       
   266     endif
       
   267 
   258     # Find all files in the source tree.
   268     # Find all files in the source tree.
   259     $1_ALL_SRCS := $$(call not-containing,_the.,\
   269     $1_ALL_SRCS := $$(call not-containing,_the.,\
   260             $$(filter $$(addprefix %,$$($1_SUFFIXES)),$$(call CacheFind $$($1_SRC))))
   270             $$(filter $$(addprefix %,$$($1_SUFFIXES)),$$(call CacheFind,$$($1_FIND_LIST))))
   261 
   271 
   262     ifneq ($$($1_INCLUDES),)
   272     ifneq ($$($1_INCLUDES),)
   263         $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
       
   264         ifneq ($$($1_SUFFIXES),)
   273         ifneq ($$($1_SUFFIXES),)
   265             $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES),\
   274             $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES),\
   266 		$$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES))))
   275 		$$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES))))
   267         else
   276         else
   268             $1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES)))
   277             $1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES)))
   269         endif
   278         endif
   270     endif
   279     endif
   271     ifneq ($$($1_INCLUDE_FILES),)
   280     ifneq ($$($1_INCLUDE_FILES),)
   272         $1_SRC_INCLUDES += $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
       
   273         $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES))
   281         $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES))
   274     endif
       
   275     ifneq ($$($1_SRC_INCLUDES),)
       
   276         $1_ALL_SRCS     := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_SRCS))
       
   277     endif
   282     endif
   278     ifneq ($$($1_EXCLUDES),)
   283     ifneq ($$($1_EXCLUDES),)
   279         $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
   284         $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
   280         $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
   285         $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
   281         $1_ALL_SRCS     := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS))
   286         $1_ALL_SRCS     := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS))