make/common/JavaCompilation.gmk
changeset 27560 adc258b13e2c
parent 26671 b214ab286ce9
child 27602 236555ddac42
equal deleted inserted replaced
27559:23d1529db8c7 27560:adc258b13e2c
   323   endif
   323   endif
   324   ifneq ($$($1_INCLUDE_FILES),)
   324   ifneq ($$($1_INCLUDE_FILES),)
   325     $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES))
   325     $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES))
   326   endif
   326   endif
   327   ifneq ($$($1_EXCLUDES),)
   327   ifneq ($$($1_EXCLUDES),)
       
   328     $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
   328     $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
   329     $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
   329     $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
       
   330     $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS))
   330     $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS))
       
   331   endif
       
   332   ifneq ($$($1_EXCLUDE_FILES),)
       
   333     # Cannot precompute ZIP_EXCLUDE_FILES as it is dependent on which src root is being
       
   334     # zipped at the moment.
       
   335     $1_SRC_EXCLUDE_FILES := $$(addprefix %, $$($1_EXCLUDE_FILES)) $$($1_EXCLUDE_FILES)
       
   336     $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDE_FILES), $$($1_ALL_SRCS))
   331   endif
   337   endif
   332 
   338 
   333   # Use a slightly shorter name for logging, but with enough path to identify this zip.
   339   # Use a slightly shorter name for logging, but with enough path to identify this zip.
   334   $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP))
   340   $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP))
   335 
   341 
   341   # If zip has nothing to do, it returns 12 and would fail the build. Check for 12
   347   # If zip has nothing to do, it returns 12 and would fail the build. Check for 12
   342   # and only fail if it's not.
   348   # and only fail if it's not.
   343   $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
   349   $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
   344 	$(MKDIR) -p $$(@D)
   350 	$(MKDIR) -p $$(@D)
   345 	$(ECHO) Updating $$($1_NAME)
   351 	$(ECHO) Updating $$($1_NAME)
   346 	$$(foreach i,$$($1_SRC),(cd $$i && $(ZIP) -qru $$@ . $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* $$(addprefix -x$(SPACE),$$(patsubst $$i/%,%,$$($1_EXCLUDE_FILES))) || test "$$$$?" = "12" )$$(NEWLINE)) true
   352 	$$(foreach i,$$($1_SRC),(cd $$i && $(ZIP) -qru $$@ . $$($1_ZIP_INCLUDES) \
       
   353 	    $$($1_ZIP_EXCLUDES) -x \*_the.\* \
       
   354 	    $$(addprefix -x$(SPACE), $$(patsubst $$i/%,%, $$($1_EXCLUDE_FILES))) \
       
   355 	    || test "$$$$?" = "12" )$$(NEWLINE)) true
   347 	$(TOUCH) $$@
   356 	$(TOUCH) $$@
   348 
   357 
   349   # Add zip to target list
   358   # Add zip to target list
   350   $1 += $$($1_ZIP)
   359   $1 += $$($1_ZIP)
   351 endef
   360 endef