1.1 --- a/common/makefiles/JavaCompilation.gmk Wed Oct 09 18:51:32 2013 -0700 1.2 +++ b/common/makefiles/JavaCompilation.gmk Thu Oct 10 14:58:19 2013 +0200 1.3 @@ -35,288 +35,288 @@ 1.4 # of removing duplicates. It is actually this side effect that is 1.5 # desired whenever sort is used below! 1.6 1.7 -ifeq (,$(_MAKEBASE_GMK)) 1.8 - $(error You must include MakeBase.gmk prior to including JavaCompilation.gmk) 1.9 +ifeq (,$(_MAKEBASE_GMK)) 1.10 + $(error You must include MakeBase.gmk prior to including JavaCompilation.gmk) 1.11 endif 1.12 1.13 FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST 1.14 1.15 define SetupJavaCompiler 1.16 - # param 1 is for example GENERATE_OLD_BYTECODE or GENERATE_NEW_JDKBYTECODE 1.17 - # This is the name of the compiler setup. 1.18 - # param 2-9 are named args. 1.19 - # JVM:=The jvm used to run the javac/javah command 1.20 - # JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out 1.21 - # FLAGS:=Flags to be supplied to javac 1.22 - # SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here 1.23 - # SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above. 1.24 - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 1.25 - $(call LogSetupMacroEntry,SetupJavaCompiler($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 1.26 - $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk)) 1.27 + # param 1 is for example GENERATE_OLD_BYTECODE or GENERATE_NEW_JDKBYTECODE 1.28 + # This is the name of the compiler setup. 1.29 + # param 2-9 are named args. 1.30 + # JVM:=The jvm used to run the javac/javah command 1.31 + # JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out 1.32 + # FLAGS:=Flags to be supplied to javac 1.33 + # SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here 1.34 + # SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above. 1.35 + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 1.36 + $(call LogSetupMacroEntry,SetupJavaCompiler($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 1.37 + $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk)) 1.38 1.39 - # The port file contains the tcp/ip on which the server listens 1.40 - # and the cookie necessary to talk to the server. 1.41 - $1_SJAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port 1.42 - # You can use a different JVM to run the background javac server. 1.43 - ifeq ($$($1_SERVER_JVM),) 1.44 - # It defaults to the same JVM that is used to start the javac command. 1.45 - $1_SERVER_JVM:=$$($1_JVM) 1.46 - endif 1.47 + # The port file contains the tcp/ip on which the server listens 1.48 + # and the cookie necessary to talk to the server. 1.49 + $1_SJAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port 1.50 + # You can use a different JVM to run the background javac server. 1.51 + ifeq ($$($1_SERVER_JVM),) 1.52 + # It defaults to the same JVM that is used to start the javac command. 1.53 + $1_SERVER_JVM:=$$($1_JVM) 1.54 + endif 1.55 endef 1.56 1.57 define SetupArchive 1.58 - # param 1 is for example ARCHIVE_MYPACKAGE 1.59 - # param 2 are the dependecies 1.60 - # param 3,4,5,6,7,8,9 are named args. 1.61 - # SRCS:=List of directories in where to find files to add to archive 1.62 - # SUFFIXES:=File suffixes to include in jar 1.63 - # INCLUDES:=List of directories/packages in SRCS that should be included 1.64 - # EXCLUDES:=List of directories/packages in SRCS that should be excluded 1.65 - # EXCLUDE_FILES:=List of files in SRCS that should be excluded 1.66 - # EXTRA_FILES:=List of files in SRCS that should be included regardless of suffix match. 1.67 - # JAR:=Jar file to create 1.68 - # MANIFEST:=Optional manifest file template. 1.69 - # JARMAIN:=Optional main class to add to manifest 1.70 - # JARINDEX:=true means generate the index in the jar file. 1.71 - # SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically 1.72 - # added to the archive. 1.73 - # EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest. 1.74 - # CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable 1.75 + # param 1 is for example ARCHIVE_MYPACKAGE 1.76 + # param 2 are the dependecies 1.77 + # param 3,4,5,6,7,8,9 are named args. 1.78 + # SRCS:=List of directories in where to find files to add to archive 1.79 + # SUFFIXES:=File suffixes to include in jar 1.80 + # INCLUDES:=List of directories/packages in SRCS that should be included 1.81 + # EXCLUDES:=List of directories/packages in SRCS that should be excluded 1.82 + # EXCLUDE_FILES:=List of files in SRCS that should be excluded 1.83 + # EXTRA_FILES:=List of files in SRCS that should be included regardless of suffix match. 1.84 + # JAR:=Jar file to create 1.85 + # MANIFEST:=Optional manifest file template. 1.86 + # JARMAIN:=Optional main class to add to manifest 1.87 + # JARINDEX:=true means generate the index in the jar file. 1.88 + # SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically 1.89 + # added to the archive. 1.90 + # EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest. 1.91 + # CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable 1.92 1.93 - # NOTE: $2 is dependencies, not a named argument! 1.94 - $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 1.95 - $(call LogSetupMacroEntry,SetupArchive($1),<dependencies>,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 1.96 - $(if $(findstring $(LOG_LEVEL),debug trace), $(info *[2] <dependencies> = $(strip $2))) 1.97 - $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk)) 1.98 + # NOTE: $2 is dependencies, not a named argument! 1.99 + $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 1.100 + $(call LogSetupMacroEntry,SetupArchive($1),<dependencies>,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 1.101 + $(if $(findstring $(LOG_LEVEL),debug trace), $(info *[2] <dependencies> = $(strip $2))) 1.102 + $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk)) 1.103 1.104 - $1_JARMAIN:=$(strip $$($1_JARMAIN)) 1.105 - $1_JARNAME:=$$(notdir $$($1_JAR)) 1.106 - $1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest 1.107 - $1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess 1.108 - $1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes 1.109 - $1_BIN:=$$(dir $$($1_JAR)) 1.110 + $1_JARMAIN:=$(strip $$($1_JARMAIN)) 1.111 + $1_JARNAME:=$$(notdir $$($1_JAR)) 1.112 + $1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest 1.113 + $1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess 1.114 + $1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes 1.115 + $1_BIN:=$$(dir $$($1_JAR)) 1.116 1.117 - ifeq (,$$($1_SUFFIXES)) 1.118 - # No suffix was set, default to classes. 1.119 - $1_SUFFIXES:=.class 1.120 + ifeq (,$$($1_SUFFIXES)) 1.121 + # No suffix was set, default to classes. 1.122 + $1_SUFFIXES:=.class 1.123 + endif 1.124 + # Convert suffixes to a find expression 1.125 + $1_FIND_PATTERNS:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES)) 1.126 + # On windows, a lot of includes/excludes risk making the command line too long, so 1.127 + # writing the grep patterns to files. 1.128 + ifneq (,$$($1_INCLUDES)) 1.129 + $1_GREP_INCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS), \ 1.130 + $$(addprefix $$(src)/,$$($1_INCLUDES))) 1.131 + # If there are a lot of include patterns, output to file to shorten command lines 1.132 + ifeq ($$(word 20,$$($1_GREP_INCLUDE_PATTERNS)),) 1.133 + $1_GREP_INCLUDES:=| $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) 1.134 + else 1.135 + $1_GREP_INCLUDE_OUTPUT:=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include && \ 1.136 + $$(strip $$(call ListPathsSafely,$1_GREP_INCLUDE_PATTERNS,\n, \ 1.137 + >> $$($1_BIN)/_the.$$($1_JARNAME)_include)) 1.138 + $1_GREP_INCLUDES:=| $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include 1.139 endif 1.140 - # Convert suffixes to a find expression 1.141 - $1_FIND_PATTERNS:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES)) 1.142 - # On windows, a lot of includes/excludes risk making the command line too long, so 1.143 - # writing the grep patterns to files. 1.144 - ifneq (,$$($1_INCLUDES)) 1.145 - $1_GREP_INCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),\ 1.146 - $$(addprefix $$(src)/,$$($1_INCLUDES))) 1.147 - # If there are a lot of include patterns, output to file to shorten command lines 1.148 - ifeq ($$(word 20,$$($1_GREP_INCLUDE_PATTERNS)),) 1.149 - $1_GREP_INCLUDES:=| $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) 1.150 - else 1.151 - $1_GREP_INCLUDE_OUTPUT:=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include && \ 1.152 - $$(strip $$(call ListPathsSafely,$1_GREP_INCLUDE_PATTERNS,\n, \ 1.153 - >> $$($1_BIN)/_the.$$($1_JARNAME)_include)) 1.154 - $1_GREP_INCLUDES:=| $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include 1.155 - endif 1.156 + endif 1.157 + ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES)) 1.158 + $1_GREP_EXCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/, \ 1.159 + $$($1_EXCLUDES) $$($1_EXCLUDE_FILES))) 1.160 + # If there are a lot of include patterns, output to file to shorten command lines 1.161 + ifeq ($$(word 20,$$($1_GREP_EXCLUDE_PATTERNS)),) 1.162 + $1_GREP_EXCLUDES:=| $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) 1.163 + else 1.164 + $1_GREP_EXCLUDE_OUTPUT=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_exclude && \ 1.165 + $$(strip $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS,\n, \ 1.166 + >> $$($1_BIN)/_the.$$($1_JARNAME)_exclude)) 1.167 + $1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude 1.168 endif 1.169 - ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES)) 1.170 - $1_GREP_EXCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,\ 1.171 - $$($1_EXCLUDES) $$($1_EXCLUDE_FILES))) 1.172 - # If there are a lot of include patterns, output to file to shorten command lines 1.173 - ifeq ($$(word 20,$$($1_GREP_EXCLUDE_PATTERNS)),) 1.174 - $1_GREP_EXCLUDES:=| $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) 1.175 - else 1.176 - $1_GREP_EXCLUDE_OUTPUT=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_exclude && \ 1.177 - $$(strip $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS,\n, \ 1.178 - >> $$($1_BIN)/_the.$$($1_JARNAME)_exclude)) 1.179 - $1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude 1.180 - endif 1.181 + endif 1.182 + 1.183 + # Check if this jar needs to have its index generated. 1.184 + ifneq (,$$($1_JARINDEX)) 1.185 + $1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@)) 1.186 + else 1.187 + $1_JARINDEX = true 1.188 + endif 1.189 + # When this macro is run in the same makefile as the java compilation, dependencies are 1.190 + # transfered in make variables. When the macro is run in a different makefile than the 1.191 + # java compilation, the dependencies need to be found in the filesystem. 1.192 + ifneq (,$2) 1.193 + $1_DEPS:=$2 1.194 + else 1.195 + $1_DEPS:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \ 1.196 + $$(call CacheFind,$$($1_SRCS))) 1.197 + ifneq (,$$($1_GREP_INCLUDE_PATTERNS)) 1.198 + $1_DEPS:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPS)) 1.199 endif 1.200 + ifneq (,$$($1_GREP_EXCLUDE_PATTERNS)) 1.201 + $1_DEPS:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPS)) 1.202 + endif 1.203 + # The subst of \ is needed because $ has to be escaped with \ in EXTRA_FILES for the command 1.204 + # lines, but not here for use in make dependencies. 1.205 + $1_DEPS+=$$(subst \,,$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,$$($1_EXTRA_FILES)))) 1.206 + ifeq (,$$($1_SKIP_METAINF)) 1.207 + $1_DEPS+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS)))) 1.208 + endif 1.209 + endif 1.210 1.211 - # Check if this jar needs to have its index generated. 1.212 - ifneq (,$$($1_JARINDEX)) 1.213 - $1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@)) 1.214 - else 1.215 - $1_JARINDEX = true 1.216 + # Utility macros, to make the shell script receipt somewhat easier to decipher. 1.217 + 1.218 + # The capture contents macro finds all files (matching the patterns, typically 1.219 + # .class and .prp) that are newer than the jar-file, ie the new content to be put into the jar. 1.220 + $1_CAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS), \ 1.221 + (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \ 1.222 + $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' && \ 1.223 + $(ECHO) $$(subst $$(src)/,,$$($1_EXTRA_FILES))) > \ 1.224 + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) 1.225 + # The capture metainf macro finds all files below the META-INF directory that are newer than the jar-file. 1.226 + ifeq (,$$($1_SKIP_METAINF)) 1.227 + $1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS),($(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents ) $$(NEWLINE)) 1.228 + endif 1.229 + # The capture deletes macro finds all deleted files and concatenates them. The resulting file 1.230 + # tells us what to remove from the jar-file. 1.231 + $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE)) 1.232 + # The update contents macro updates the jar file with the previously capture contents. 1.233 + # xargs is used to trim the whitespace from the contents file, to see if it is empty. 1.234 + $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS), \ 1.235 + (cd $$(src) && \ 1.236 + if [ -n "`$(CAT) _the.$$($1_JARNAME)_contents | $(XARGS)`" ]; then \ 1.237 + $(ECHO) " updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \ 1.238 + $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \ 1.239 + fi) $$(NEWLINE)) 1.240 + # The s-variants of the above macros are used when the jar is created from scratch. 1.241 + $1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS), \ 1.242 + (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \ 1.243 + $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' && \ 1.244 + $$(subst $$(src)/,,$(ECHO) $$($1_EXTRA_FILES))) > \ 1.245 + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) 1.246 + 1.247 + ifeq (,$$($1_SKIP_METAINF)) 1.248 + $1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS), \ 1.249 + ($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> \ 1.250 + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) 1.251 + endif 1.252 + $1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS), \ 1.253 + (cd $$(src) && $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) 1.254 + 1.255 + # Use a slightly shorter name for logging, but with enough path to identify this jar. 1.256 + $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR)) 1.257 + 1.258 + ifneq (,$$($1_CHECK_COMPRESS_JAR)) 1.259 + $1_JAR_CREATE_OPTIONS := c0fm 1.260 + $1_JAR_UPDATE_OPTIONS := u0f 1.261 + ifeq ($(COMPRESS_JARS), true) 1.262 + $1_JAR_CREATE_OPTIONS := cfm 1.263 + $1_JAR_UPDATE_OPTIONS := uf 1.264 endif 1.265 - # When this macro is run in the same makefile as the java compilation, dependencies are 1.266 - # transfered in make variables. When the macro is run in a different makefile than the 1.267 - # java compilation, the dependencies need to be found in the filesystem. 1.268 - ifneq (,$2) 1.269 - $1_DEPS:=$2 1.270 - else 1.271 - $1_DEPS:=$$(filter $$(addprefix %,$$($1_SUFFIXES)),\ 1.272 - $$(call CacheFind,$$($1_SRCS))) 1.273 - ifneq (,$$($1_GREP_INCLUDE_PATTERNS)) 1.274 - $1_DEPS:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPS)) 1.275 - endif 1.276 - ifneq (,$$($1_GREP_EXCLUDE_PATTERNS)) 1.277 - $1_DEPS:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPS)) 1.278 - endif 1.279 - # The subst of \ is needed because $ has to be escaped with \ in EXTRA_FILES for the command 1.280 - # lines, but not here for use in make dependencies. 1.281 - $1_DEPS+=$$(subst \,,$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,$$($1_EXTRA_FILES)))) 1.282 - ifeq (,$$($1_SKIP_METAINF)) 1.283 - $1_DEPS+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS)))) 1.284 - endif 1.285 - endif 1.286 + else 1.287 + $1_JAR_CREATE_OPTIONS := cfm 1.288 + $1_JAR_UPDATE_OPTIONS := uf 1.289 + endif 1.290 1.291 - # Utility macros, to make the shell script receipt somewhat easier to decipher. 1.292 - 1.293 - # The capture contents macro finds all files (matching the patterns, typically 1.294 - # .class and .prp) that are newer than the jar-file, ie the new content to be put into the jar. 1.295 - $1_CAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\ 1.296 - (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \ 1.297 - $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' &&\ 1.298 - $(ECHO) $$(subst $$(src)/,,$$($1_EXTRA_FILES))) > \ 1.299 - $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) 1.300 - # The capture metainf macro finds all files below the META-INF directory that are newer than the jar-file. 1.301 - ifeq (,$$($1_SKIP_METAINF)) 1.302 - $1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS),($(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents ) $$(NEWLINE)) 1.303 - endif 1.304 - # The capture deletes macro finds all deleted files and concatenates them. The resulting file 1.305 - # tells us what to remove from the jar-file. 1.306 - $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE)) 1.307 - # The update contents macro updates the jar file with the previously capture contents. 1.308 - # xargs is used to trim the whitespace from the contents file, to see if it is empty. 1.309 - $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\ 1.310 - (cd $$(src) && \ 1.311 - if [ -n "`$(CAT) _the.$$($1_JARNAME)_contents | $(XARGS)`" ]; then \ 1.312 - $(ECHO) " updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \ 1.313 - $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \ 1.314 - fi) $$(NEWLINE)) 1.315 - # The s-variants of the above macros are used when the jar is created from scratch. 1.316 - $1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\ 1.317 - (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \ 1.318 - $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' &&\ 1.319 - $$(subst $$(src)/,,$(ECHO) $$($1_EXTRA_FILES))) > \ 1.320 - $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) 1.321 - 1.322 - ifeq (,$$($1_SKIP_METAINF)) 1.323 - $1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS),\ 1.324 - ($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> \ 1.325 - $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) 1.326 - endif 1.327 - $1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\ 1.328 - (cd $$(src) && $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) 1.329 - 1.330 - # Use a slightly shorter name for logging, but with enough path to identify this jar. 1.331 - $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR)) 1.332 - 1.333 - ifneq (,$$($1_CHECK_COMPRESS_JAR)) 1.334 - $1_JAR_CREATE_OPTIONS := c0fm 1.335 - $1_JAR_UPDATE_OPTIONS := u0f 1.336 - ifeq ($(COMPRESS_JARS), true) 1.337 - $1_JAR_CREATE_OPTIONS := cfm 1.338 - $1_JAR_UPDATE_OPTIONS := uf 1.339 - endif 1.340 - else 1.341 - $1_JAR_CREATE_OPTIONS := cfm 1.342 - $1_JAR_UPDATE_OPTIONS := uf 1.343 - endif 1.344 - 1.345 - # Here is the rule that creates/updates the jar file. 1.346 - $$($1_JAR) : $$($1_DEPS) 1.347 + # Here is the rule that creates/updates the jar file. 1.348 + $$($1_JAR) : $$($1_DEPS) 1.349 $(MKDIR) -p $$($1_BIN) 1.350 $$($1_GREP_INCLUDE_OUTPUT) 1.351 $$($1_GREP_EXCLUDE_OUTPUT) 1.352 - $$(if $$($1_MANIFEST),\ 1.353 - $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ 1.354 - -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $$($1_MANIFEST) > $$($1_MANIFEST_FILE) \ 1.355 - ,\ 1.356 - $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE)) 1.357 + $$(if $$($1_MANIFEST), \ 1.358 + $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ 1.359 + -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $$($1_MANIFEST) > $$($1_MANIFEST_FILE) \ 1.360 + , \ 1.361 + $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE)) 1.362 $$(if $$($1_JARMAIN),$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE)) 1.363 $$(if $$($1_EXTRA_MANIFEST_ATTR),$(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE)) 1.364 - $$(if $$(wildcard $$@),\ 1.365 - $(ECHO) Modifying $$($1_NAME) $$(NEWLINE)\ 1.366 - $$($1_CAPTURE_CONTENTS) \ 1.367 - $$($1_CAPTURE_METAINF) \ 1.368 - $(RM) $$($1_DELETES_FILE) $$(NEWLINE)\ 1.369 - $$($1_CAPTURE_DELETES) \ 1.370 - $(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) $$(NEWLINE)\ 1.371 - if [ -s $$($1_DELETESS_FILE) ]; then \ 1.372 - $(ECHO) " deleting" `$(WC) -l $$($1_DELETESS_FILE) | $(AWK) '{ print $$$$1 }'` files && \ 1.373 - $(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \ 1.374 - fi $$(NEWLINE) \ 1.375 - $$($1_UPDATE_CONTENTS) true $$(NEWLINE) \ 1.376 - $$($1_JARINDEX) && true \ 1.377 - ,\ 1.378 - $(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \ 1.379 - $$($1_SCAPTURE_CONTENTS) \ 1.380 - $$($1_SCAPTURE_METAINF) \ 1.381 - $$($1_SUPDATE_CONTENTS) \ 1.382 - $$($1_JARINDEX) && true ) 1.383 + $$(if $$(wildcard $$@), \ 1.384 + $(ECHO) Modifying $$($1_NAME) $$(NEWLINE) \ 1.385 + $$($1_CAPTURE_CONTENTS) \ 1.386 + $$($1_CAPTURE_METAINF) \ 1.387 + $(RM) $$($1_DELETES_FILE) $$(NEWLINE) \ 1.388 + $$($1_CAPTURE_DELETES) \ 1.389 + $(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) $$(NEWLINE) \ 1.390 + if [ -s $$($1_DELETESS_FILE) ]; then \ 1.391 + $(ECHO) " deleting" `$(WC) -l $$($1_DELETESS_FILE) | $(AWK) '{ print $$$$1 }'` files && \ 1.392 + $(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \ 1.393 + fi $$(NEWLINE) \ 1.394 + $$($1_UPDATE_CONTENTS) true $$(NEWLINE) \ 1.395 + $$($1_JARINDEX) && true \ 1.396 + , \ 1.397 + $(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \ 1.398 + $$($1_SCAPTURE_CONTENTS) \ 1.399 + $$($1_SCAPTURE_METAINF) \ 1.400 + $$($1_SUPDATE_CONTENTS) \ 1.401 + $$($1_JARINDEX) && true ) 1.402 1.403 endef 1.404 1.405 define SetupZipArchive 1.406 - # param 1 is for example ZIP_MYSOURCE 1.407 - # param 2,3,4,5,6,7,8,9 are named args. 1.408 - # SRC,ZIP,INCLUDES,INCLUDE_FILES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS 1.409 - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 1.410 - $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 1.411 - $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk)) 1.412 + # param 1 is for example ZIP_MYSOURCE 1.413 + # param 2,3,4,5,6,7,8,9 are named args. 1.414 + # SRC,ZIP,INCLUDES,INCLUDE_FILES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS 1.415 + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 1.416 + $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 1.417 + $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk)) 1.418 1.419 - # To avoid running find over too large sets of files, which causes make to crash 1.420 - # on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set 1.421 - # of directories to run find in, if available. 1.422 - ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),) 1.423 - $1_FIND_LIST := $$(wildcard $$(foreach i,$$($1_SRC),\ 1.424 - $$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES)))) 1.425 + # To avoid running find over too large sets of files, which causes make to crash 1.426 + # on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set 1.427 + # of directories to run find in, if available. 1.428 + ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),) 1.429 + $1_FIND_LIST := $$(wildcard $$(foreach i,$$($1_SRC), \ 1.430 + $$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES)))) 1.431 + else 1.432 + $1_FIND_LIST := $$($1_SRC) 1.433 + endif 1.434 + 1.435 + # Find all files in the source tree. 1.436 + $1_ALL_SRCS := $$(call not-containing,_the., \ 1.437 + $$(filter $$(addprefix %,$$($1_SUFFIXES)),$$(call CacheFind,$$($1_FIND_LIST)))) 1.438 + 1.439 + ifneq ($$($1_INCLUDES),) 1.440 + ifneq ($$($1_SUFFIXES),) 1.441 + $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES), \ 1.442 + $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES)))) 1.443 else 1.444 - $1_FIND_LIST := $$($1_SRC) 1.445 + $1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES))) 1.446 endif 1.447 + endif 1.448 + ifneq ($$($1_INCLUDE_FILES),) 1.449 + $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES)) 1.450 + endif 1.451 + ifneq ($$($1_EXCLUDES),) 1.452 + $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) 1.453 + $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES))) 1.454 + $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS)) 1.455 + endif 1.456 1.457 - # Find all files in the source tree. 1.458 - $1_ALL_SRCS := $$(call not-containing,_the.,\ 1.459 - $$(filter $$(addprefix %,$$($1_SUFFIXES)),$$(call CacheFind,$$($1_FIND_LIST)))) 1.460 + # Use a slightly shorter name for logging, but with enough path to identify this zip. 1.461 + $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP)) 1.462 1.463 - ifneq ($$($1_INCLUDES),) 1.464 - ifneq ($$($1_SUFFIXES),) 1.465 - $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES),\ 1.466 - $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES)))) 1.467 - else 1.468 - $1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES))) 1.469 - endif 1.470 - endif 1.471 - ifneq ($$($1_INCLUDE_FILES),) 1.472 - $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES)) 1.473 - endif 1.474 - ifneq ($$($1_EXCLUDES),) 1.475 - $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) 1.476 - $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES))) 1.477 - $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS)) 1.478 - endif 1.479 - 1.480 - # Use a slightly shorter name for logging, but with enough path to identify this zip. 1.481 - $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP)) 1.482 - 1.483 - # Now $1_ALL_SRCS should contain all sources that are going to be put into the zip. 1.484 - # I.e. the zip -i and -x options should match the filtering done in the makefile. 1.485 - # Explicitly excluded files can be given with absolute path. The patsubst solution 1.486 - # isn't perfect but the likelyhood of an absolute path to match something in a src 1.487 - # dir is very small. 1.488 - # If zip has nothing to do, it returns 12 and would fail the build. Check for 12 1.489 - # and only fail if it's not. 1.490 - $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS) 1.491 - $(MKDIR) -p $$(@D) 1.492 - $(ECHO) Updating $$($1_NAME) 1.493 - $$(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 1.494 - $(TOUCH) $$@ 1.495 + # Now $1_ALL_SRCS should contain all sources that are going to be put into the zip. 1.496 + # I.e. the zip -i and -x options should match the filtering done in the makefile. 1.497 + # Explicitly excluded files can be given with absolute path. The patsubst solution 1.498 + # isn't perfect but the likelyhood of an absolute path to match something in a src 1.499 + # dir is very small. 1.500 + # If zip has nothing to do, it returns 12 and would fail the build. Check for 12 1.501 + # and only fail if it's not. 1.502 + $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS) 1.503 + $(MKDIR) -p $$(@D) 1.504 + $(ECHO) Updating $$($1_NAME) 1.505 + $$(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 1.506 + $(TOUCH) $$@ 1.507 endef 1.508 1.509 define add_file_to_copy 1.510 - # param 1 = BUILD_MYPACKAGE 1.511 - # parma 2 = The source file to copy. 1.512 - $2_TARGET:=$2 1.513 - # Remove the source prefix. 1.514 - $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET))) 1.515 - # Now we can setup the depency that will trigger the copying. 1.516 - $$($1_BIN)$$($2_TARGET) : $2 1.517 + # param 1 = BUILD_MYPACKAGE 1.518 + # parma 2 = The source file to copy. 1.519 + $2_TARGET:=$2 1.520 + # Remove the source prefix. 1.521 + $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET))) 1.522 + # Now we can setup the depency that will trigger the copying. 1.523 + $$($1_BIN)$$($2_TARGET) : $2 1.524 $(MKDIR) -p $$(@D) 1.525 $(CP) $$< $$@ 1.526 $(CHMOD) -f ug+w $$@ 1.527 1.528 - # And do not forget this target 1.529 - $1_ALL_COPY_TARGETS += $$($1_BIN)$$($2_TARGET) 1.530 + # And do not forget this target 1.531 + $1_ALL_COPY_TARGETS += $$($1_BIN)$$($2_TARGET) 1.532 endef 1.533 1.534 1.535 @@ -326,206 +326,206 @@ 1.536 # This is the new clean standard. Though it is to be superseded by 1.537 # a standard annotation processor from with sjavac. 1.538 define add_file_to_copy_and_clean 1.539 - # param 1 = BUILD_MYPACKAGE 1.540 - # parma 2 = The source file to copy and clean. 1.541 - $2_TARGET:=$2 1.542 - # Remove the source prefix. 1.543 - $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET))) 1.544 - # Now we can setup the depency that will trigger the copying. 1.545 - $$($1_BIN)$$($2_TARGET) : $2 1.546 + # param 1 = BUILD_MYPACKAGE 1.547 + # parma 2 = The source file to copy and clean. 1.548 + $2_TARGET:=$2 1.549 + # Remove the source prefix. 1.550 + $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET))) 1.551 + # Now we can setup the depency that will trigger the copying. 1.552 + $$($1_BIN)$$($2_TARGET) : $2 1.553 $(MKDIR) -p $$(@D) 1.554 - $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ 1.555 - | $(SED) -f "$(SRC_ROOT)/common/makefiles/support/unicode2x.sed" \ 1.556 - | $(SED) -e '/^#/d' -e '/^$$$$/d' \ 1.557 - -e :a -e '/\\$$$$/N; s/\\\n//; ta' \ 1.558 - -e 's/^[ \t]*//;s/[ \t]*$$$$//' \ 1.559 - -e 's/\\=/=/' | LANG=C $(SORT) > $$@ 1.560 + $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ 1.561 + | $(SED) -f "$(SRC_ROOT)/common/makefiles/support/unicode2x.sed" \ 1.562 + | $(SED) -e '/^#/d' -e '/^$$$$/d' \ 1.563 + -e :a -e '/\\$$$$/N; s/\\\n//; ta' \ 1.564 + -e 's/^[ \t]*//;s/[ \t]*$$$$//' \ 1.565 + -e 's/\\=/=/' | LANG=C $(SORT) > $$@ 1.566 $(CHMOD) -f ug+w $$@ 1.567 1.568 - # And do not forget this target 1.569 - $1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET) 1.570 + # And do not forget this target 1.571 + $1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET) 1.572 endef 1.573 1.574 define remove_string 1.575 - $2 := $$(subst $1,,$$($2)) 1.576 + $2 := $$(subst $1,,$$($2)) 1.577 endef 1.578 1.579 define replace_space_with_pathsep 1.580 - $1:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$2))) 1.581 + $1:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$2))) 1.582 endef 1.583 1.584 define SetupJavaCompilation 1.585 - # param 1 is for example BUILD_MYPACKAGE 1.586 - # param 2,3,4,5,6,7,8 are named args. 1.587 - # SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC 1.588 - # JVM:=path to ..bin/java 1.589 - # ADD_JAVAC_FLAGS:=javac flags to append to the default ones. 1.590 - # SRC:=one or more directories to search for sources 1.591 - # BIN:=store classes here 1.592 - # INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages. 1.593 - # EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages. 1.594 - # COPY:=.prp means copy all prp files to the corresponding package in BIN. 1.595 - # CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN. 1.596 - # COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo 1.597 - # SRCZIP:=Create a src.zip based on the found sources and copied files. 1.598 - # INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file! 1.599 - # EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file! 1.600 - # "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found. 1.601 - # JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=Don't use this. This forces an explicit -sourcepath to javac. 1.602 - # Its only here until we cleanup some nasty source code pasta in the jdk. 1.603 - # HEADERS:=path to directory where all generated c-headers are written. 1.604 - # DEPENDS:=Extra dependecy 1.605 - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 1.606 - $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 1.607 - $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk)) 1.608 + # param 1 is for example BUILD_MYPACKAGE 1.609 + # param 2,3,4,5,6,7,8 are named args. 1.610 + # SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC 1.611 + # JVM:=path to ..bin/java 1.612 + # ADD_JAVAC_FLAGS:=javac flags to append to the default ones. 1.613 + # SRC:=one or more directories to search for sources 1.614 + # BIN:=store classes here 1.615 + # INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages. 1.616 + # EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages. 1.617 + # COPY:=.prp means copy all prp files to the corresponding package in BIN. 1.618 + # CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN. 1.619 + # COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo 1.620 + # SRCZIP:=Create a src.zip based on the found sources and copied files. 1.621 + # INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file! 1.622 + # EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file! 1.623 + # "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found. 1.624 + # JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=Don't use this. This forces an explicit -sourcepath to javac. 1.625 + # Its only here until we cleanup some nasty source code pasta in the jdk. 1.626 + # HEADERS:=path to directory where all generated c-headers are written. 1.627 + # DEPENDS:=Extra dependecy 1.628 + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 1.629 + $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 1.630 + $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk)) 1.631 1.632 - # Extract the info from the java compiler setup. 1.633 - $1_JVM := $$($$($1_SETUP)_JVM) 1.634 - $1_JAVAC := $$($$($1_SETUP)_JAVAC) 1.635 - $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS) 1.636 - ifeq ($$($1_JAVAC),) 1.637 - $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP)) 1.638 + # Extract the info from the java compiler setup. 1.639 + $1_JVM := $$($$($1_SETUP)_JVM) 1.640 + $1_JAVAC := $$($$($1_SETUP)_JAVAC) 1.641 + $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS) 1.642 + ifeq ($$($1_JAVAC),) 1.643 + $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP)) 1.644 + endif 1.645 + $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE) 1.646 + $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM) 1.647 + 1.648 + # Handle addons and overrides. 1.649 + $1_SRC:=$$(call ADD_SRCS,$$($1_SRC)) 1.650 + # Make sure the dirs exist. 1.651 + $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d))) 1.652 + $$(eval $$(call MakeDir,$$($1_BIN))) 1.653 + # Find all files in the source trees. 1.654 + $1_ALL_SRCS += $$(filter-out $(OVR_SRCS),$$(call CacheFind,$$($1_SRC))) 1.655 + # Extract the java files. 1.656 + ifneq ($$($1_EXCLUDE_FILES),) 1.657 + $1_EXCLUDE_FILES_PATTERN:=$$(addprefix %,$$($1_EXCLUDE_FILES)) 1.658 + endif 1.659 + $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$(filter %.java,$$($1_ALL_SRCS))) 1.660 + ifneq ($$($1_INCLUDE_FILES),) 1.661 + $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES))) 1.662 + $1_SRCS := $$(filter $$($1_INCLUDE_FILES), $$($1_SRCS)) 1.663 + endif 1.664 + 1.665 + # Now we have a list of all java files to compile: $$($1_SRCS) 1.666 + 1.667 + # Create the corresponding smart javac wrapper command line. 1.668 + $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix .*,$$(subst /,.,$$($1_EXCLUDES)))) \ 1.669 + $$(addprefix -i ,$$(addsuffix .*,$$(subst /,.,$$($1_INCLUDES)))) \ 1.670 + $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES))) \ 1.671 + $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \ 1.672 + -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))" 1.673 + 1.674 + # Prepend the source/bin path to the filter expressions. 1.675 + ifneq ($$($1_INCLUDES),) 1.676 + $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES)))) 1.677 + $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) 1.678 + endif 1.679 + ifneq ($$($1_EXCLUDES),) 1.680 + $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) 1.681 + $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) 1.682 + endif 1.683 + 1.684 + # Find all files to be copied from source to bin. 1.685 + ifneq (,$$($1_COPY)) 1.686 + # Search for all files to be copied. 1.687 + $1_ALL_COPIES := $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS)) 1.688 + # Copy these explicitly 1.689 + $1_ALL_COPIES += $$($1_COPY_FILES) 1.690 + # Copy must also respect filters. 1.691 + ifneq (,$$($1_INCLUDES)) 1.692 + $1_ALL_COPIES := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_COPIES)) 1.693 endif 1.694 - $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE) 1.695 - $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM) 1.696 + ifneq (,$$($1_EXCLUDES)) 1.697 + $1_ALL_COPIES := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_COPIES)) 1.698 + endif 1.699 + ifneq (,$$($1_EXCLUDE_FILES)) 1.700 + $1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES)) 1.701 + endif 1.702 + # All files below META-INF are always copied. 1.703 + $1_ALL_COPIES += $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) 1.704 + ifneq (,$$($1_ALL_COPIES)) 1.705 + # Yep, there are files to be copied! 1.706 + $1_ALL_COPY_TARGETS:= 1.707 + $$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i))) 1.708 + # Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files! 1.709 + endif 1.710 + endif 1.711 1.712 - # Handle addons and overrides. 1.713 - $1_SRC:=$$(call ADD_SRCS,$$($1_SRC)) 1.714 - # Make sure the dirs exist. 1.715 - $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d))) 1.716 - $$(eval $$(call MakeDir,$$($1_BIN))) 1.717 - # Find all files in the source trees. 1.718 - $1_ALL_SRCS += $$(filter-out $(OVR_SRCS),$$(call CacheFind,$$($1_SRC))) 1.719 - # Extract the java files. 1.720 - ifneq ($$($1_EXCLUDE_FILES),) 1.721 - $1_EXCLUDE_FILES_PATTERN:=$$(addprefix %,$$($1_EXCLUDE_FILES)) 1.722 + # Find all property files to be copied and cleaned from source to bin. 1.723 + ifneq (,$$($1_CLEAN)) 1.724 + # Search for all files to be copied. 1.725 + $1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS)) 1.726 + # Copy and clean must also respect filters. 1.727 + ifneq (,$$($1_INCLUDES)) 1.728 + $1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS)) 1.729 endif 1.730 - $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$(filter %.java,$$($1_ALL_SRCS))) 1.731 - ifneq ($$($1_INCLUDE_FILES),) 1.732 - $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES))) 1.733 - $1_SRCS := $$(filter $$($1_INCLUDE_FILES), $$($1_SRCS)) 1.734 + ifneq (,$$($1_EXCLUDES)) 1.735 + $1_ALL_CLEANS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_CLEANS)) 1.736 + endif 1.737 + ifneq (,$$($1_EXCLUDE_FILES)) 1.738 + $1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_CLEANS)) 1.739 + endif 1.740 + ifneq (,$$($1_ALL_CLEANS)) 1.741 + # Yep, there are files to be copied and cleaned! 1.742 + $1_ALL_COPY_CLEAN_TARGETS:= 1.743 + $$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_copy_and_clean,$1,$$i))) 1.744 + # Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files! 1.745 + endif 1.746 + endif 1.747 + 1.748 + # Prep the source paths. 1.749 + ifneq ($$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE),) 1.750 + $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE))) 1.751 + else 1.752 + $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC))) 1.753 + endif 1.754 + 1.755 + # Create a sed expression to remove the source roots and to replace / with . 1.756 + # and remove .java at the end. 1.757 + $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g' 1.758 + 1.759 + ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes) 1.760 + ifneq (,$$($1_HEADERS)) 1.761 + $1_HEADERS_ARG := -h $$($1_HEADERS) 1.762 endif 1.763 1.764 - # Now we have a list of all java files to compile: $$($1_SRCS) 1.765 + # Using sjavac to compile. 1.766 + $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/javac_state 1.767 1.768 - # Create the corresponding smart javac wrapper command line. 1.769 - $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix .*,$$(subst /,.,$$($1_EXCLUDES)))) \ 1.770 - $$(addprefix -i ,$$(addsuffix .*,$$(subst /,.,$$($1_INCLUDES)))) \ 1.771 - $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES))) \ 1.772 - $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \ 1.773 - -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))" 1.774 + # Create SJAVAC variable form JAVAC variable. Expects $1_JAVAC to be 1.775 + # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main" 1.776 + # and javac is simply replaced with sjavac. 1.777 + $1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC)) 1.778 1.779 - # Prepend the source/bin path to the filter expressions. 1.780 - ifneq ($$($1_INCLUDES),) 1.781 - $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES)))) 1.782 - $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) 1.783 - endif 1.784 - ifneq ($$($1_EXCLUDES),) 1.785 - $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) 1.786 - $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) 1.787 - endif 1.788 + # Set the $1_REMOTE to spawn a background javac server. 1.789 + $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC)))) 1.790 1.791 - # Find all files to be copied from source to bin. 1.792 - ifneq (,$$($1_COPY)) 1.793 - # Search for all files to be copied. 1.794 - $1_ALL_COPIES := $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS)) 1.795 - # Copy these explicitly 1.796 - $1_ALL_COPIES += $$($1_COPY_FILES) 1.797 - # Copy must also respect filters. 1.798 - ifneq (,$$($1_INCLUDES)) 1.799 - $1_ALL_COPIES := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_COPIES)) 1.800 - endif 1.801 - ifneq (,$$($1_EXCLUDES)) 1.802 - $1_ALL_COPIES := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_COPIES)) 1.803 - endif 1.804 - ifneq (,$$($1_EXCLUDE_FILES)) 1.805 - $1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES)) 1.806 - endif 1.807 - # All files below META-INF are always copied. 1.808 - $1_ALL_COPIES += $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) 1.809 - ifneq (,$$($1_ALL_COPIES)) 1.810 - # Yep, there are files to be copied! 1.811 - $1_ALL_COPY_TARGETS:= 1.812 - $$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i))) 1.813 - # Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files! 1.814 - endif 1.815 - endif 1.816 + $$($1_BIN)/javac_state: $$($1_SRCS) $$($1_DEPENDS) 1.817 + $(MKDIR) -p $$(@D) 1.818 + $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp) 1.819 + $(ECHO) Compiling $1 1.820 + ($$($1_JVM) $$($1_SJAVAC) \ 1.821 + $$($1_REMOTE) \ 1.822 + -j $(JOBS) \ 1.823 + --permit-unidentified-artifacts \ 1.824 + --permit-sources-without-package \ 1.825 + --compare-found-sources $$($1_BIN)/_the.batch.tmp \ 1.826 + --log=$(LOG_LEVEL) \ 1.827 + $$($1_SJAVAC_ARGS) \ 1.828 + $$($1_FLAGS) \ 1.829 + $$($1_HEADERS_ARG) \ 1.830 + -d $$($1_BIN) && \ 1.831 + $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch) 1.832 + else 1.833 + # Using plain javac to batch compile everything. 1.834 + $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch 1.835 1.836 - # Find all property files to be copied and cleaned from source to bin. 1.837 - ifneq (,$$($1_CLEAN)) 1.838 - # Search for all files to be copied. 1.839 - $1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS)) 1.840 - # Copy and clean must also respect filters. 1.841 - ifneq (,$$($1_INCLUDES)) 1.842 - $1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS)) 1.843 - endif 1.844 - ifneq (,$$($1_EXCLUDES)) 1.845 - $1_ALL_CLEANS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_CLEANS)) 1.846 - endif 1.847 - ifneq (,$$($1_EXCLUDE_FILES)) 1.848 - $1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_CLEANS)) 1.849 - endif 1.850 - ifneq (,$$($1_ALL_CLEANS)) 1.851 - # Yep, there are files to be copied and cleaned! 1.852 - $1_ALL_COPY_CLEAN_TARGETS:= 1.853 - $$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_copy_and_clean,$1,$$i))) 1.854 - # Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files! 1.855 - endif 1.856 - endif 1.857 + # When building in batch, put headers in a temp dir to filter out those that actually 1.858 + # changed before copying them to the real header dir. 1.859 + ifneq (,$$($1_HEADERS)) 1.860 + $1_HEADERS_ARG := -h $$($1_HEADERS).tmp 1.861 1.862 - # Prep the source paths. 1.863 - ifneq ($$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE),) 1.864 - $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE))) 1.865 - else 1.866 - $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC))) 1.867 - endif 1.868 - 1.869 - # Create a sed expression to remove the source roots and to replace / with . 1.870 - # and remove .java at the end. 1.871 - $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g' 1.872 - 1.873 - ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes) 1.874 - ifneq (,$$($1_HEADERS)) 1.875 - $1_HEADERS_ARG := -h $$($1_HEADERS) 1.876 - endif 1.877 - 1.878 - # Using sjavac to compile. 1.879 - $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/javac_state 1.880 - 1.881 - # Create SJAVAC variable form JAVAC variable. Expects $1_JAVAC to be 1.882 - # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main" 1.883 - # and javac is simply replaced with sjavac. 1.884 - $1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC)) 1.885 - 1.886 - # Set the $1_REMOTE to spawn a background javac server. 1.887 - $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC)))) 1.888 - 1.889 - $$($1_BIN)/javac_state: $$($1_SRCS) $$($1_DEPENDS) 1.890 - $(MKDIR) -p $$(@D) 1.891 - $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp) 1.892 - $(ECHO) Compiling $1 1.893 - ($$($1_JVM) $$($1_SJAVAC) \ 1.894 - $$($1_REMOTE) \ 1.895 - -j $(JOBS) \ 1.896 - --permit-unidentified-artifacts \ 1.897 - --permit-sources-without-package \ 1.898 - --compare-found-sources $$($1_BIN)/_the.batch.tmp \ 1.899 - --log=$(LOG_LEVEL) \ 1.900 - $$($1_SJAVAC_ARGS) \ 1.901 - $$($1_FLAGS) \ 1.902 - $$($1_HEADERS_ARG) \ 1.903 - -d $$($1_BIN) && \ 1.904 - $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch) 1.905 - else 1.906 - # Using plain javac to batch compile everything. 1.907 - $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch 1.908 - 1.909 - # When building in batch, put headers in a temp dir to filter out those that actually 1.910 - # changed before copying them to the real header dir. 1.911 - ifneq (,$$($1_HEADERS)) 1.912 - $1_HEADERS_ARG := -h $$($1_HEADERS).tmp 1.913 - 1.914 - $$($1_HEADERS)/_the.headers: $$($1_BIN)/_the.batch 1.915 + $$($1_HEADERS)/_the.headers: $$($1_BIN)/_the.batch 1.916 $(MKDIR) -p $$(@D) 1.917 for f in `ls $$($1_HEADERS).tmp`; do \ 1.918 if [ ! -f "$$($1_HEADERS)/$$$$f" ] || [ "`$(DIFF) $$($1_HEADERS)/$$$$f $$($1_HEADERS).tmp/$$$$f`" != "" ]; then \ 1.919 @@ -535,54 +535,54 @@ 1.920 $(RM) -r $$($1_HEADERS).tmp 1.921 $(TOUCH) $$@ 1.922 1.923 - $1 += $$($1_HEADERS)/_the.headers 1.924 - endif 1.925 - 1.926 - # When not using sjavac, pass along all sources to javac using an @file. 1.927 - $$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS) 1.928 - $(MKDIR) -p $$(@D) 1.929 - $(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp 1.930 - $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp) 1.931 - $(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1 1.932 - ($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \ 1.933 - -implicit:none -sourcepath "$$($1_SRCROOTSC)" \ 1.934 - -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \ 1.935 - $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch) 1.936 - 1.937 + $1 += $$($1_HEADERS)/_the.headers 1.938 endif 1.939 1.940 - # Check if a jar file was specified, then setup the rules for the jar. 1.941 - ifneq (,$$($1_JAR)) 1.942 - # If no suffixes was explicitly set for this jar file. 1.943 - # Use class and the cleaned/copied properties file suffixes as the default 1.944 - # for the types of files to be put into the jar. 1.945 - ifeq (,$$($1_SUFFIXES)) 1.946 - $1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY) 1.947 - endif 1.948 + # When not using sjavac, pass along all sources to javac using an @file. 1.949 + $$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS) 1.950 + $(MKDIR) -p $$(@D) 1.951 + $(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp 1.952 + $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp) 1.953 + $(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1 1.954 + ($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \ 1.955 + -implicit:none -sourcepath "$$($1_SRCROOTSC)" \ 1.956 + -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \ 1.957 + $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch) 1.958 1.959 - $$(eval $$(call SetupArchive,ARCHIVE_$1,$$($1),\ 1.960 - SRCS:=$$($1_BIN),\ 1.961 - SUFFIXES:=$$($1_SUFFIXES),\ 1.962 - EXCLUDE:=$$($1_EXCLUDES),\ 1.963 - INCLUDES:=$$($1_INCLUDES),\ 1.964 - EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS),\ 1.965 - JAR:=$$($1_JAR),\ 1.966 - JARMAIN:=$$($1_JARMAIN),\ 1.967 - MANIFEST:=$$($1_MANIFEST),\ 1.968 - EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR),\ 1.969 - JARINDEX:=$$($1_JARINDEX),\ 1.970 - HEADERS:=$$($1_HEADERS),\ 1.971 - SETUP:=$$($1_SETUP))) 1.972 + endif 1.973 + 1.974 + # Check if a jar file was specified, then setup the rules for the jar. 1.975 + ifneq (,$$($1_JAR)) 1.976 + # If no suffixes was explicitly set for this jar file. 1.977 + # Use class and the cleaned/copied properties file suffixes as the default 1.978 + # for the types of files to be put into the jar. 1.979 + ifeq (,$$($1_SUFFIXES)) 1.980 + $1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY) 1.981 endif 1.982 1.983 - # Check if a srczip was specified, then setup the rules for the srczip. 1.984 - ifneq (,$$($1_SRCZIP)) 1.985 - $$(eval $$(call SetupZipArchive,ARCHIVE_$1,\ 1.986 - SRC:=$$($1_SRC),\ 1.987 - ZIP:=$$($1_SRCZIP),\ 1.988 - INCLUDES:=$$($1_INCLUDES),\ 1.989 - EXCLUDES:=$$($1_EXCLUDES),\ 1.990 - EXCLUDE_FILES:=$$($1_EXCLUDE_FILES))) 1.991 - endif 1.992 + $$(eval $$(call SetupArchive,ARCHIVE_$1,$$($1), \ 1.993 + SRCS:=$$($1_BIN), \ 1.994 + SUFFIXES:=$$($1_SUFFIXES), \ 1.995 + EXCLUDE:=$$($1_EXCLUDES), \ 1.996 + INCLUDES:=$$($1_INCLUDES), \ 1.997 + EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS), \ 1.998 + JAR:=$$($1_JAR), \ 1.999 + JARMAIN:=$$($1_JARMAIN), \ 1.1000 + MANIFEST:=$$($1_MANIFEST), \ 1.1001 + EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR), \ 1.1002 + JARINDEX:=$$($1_JARINDEX), \ 1.1003 + HEADERS:=$$($1_HEADERS), \ 1.1004 + SETUP:=$$($1_SETUP))) 1.1005 + endif 1.1006 + 1.1007 + # Check if a srczip was specified, then setup the rules for the srczip. 1.1008 + ifneq (,$$($1_SRCZIP)) 1.1009 + $$(eval $$(call SetupZipArchive,ARCHIVE_$1, \ 1.1010 + SRC:=$$($1_SRC), \ 1.1011 + ZIP:=$$($1_SRCZIP), \ 1.1012 + INCLUDES:=$$($1_INCLUDES), \ 1.1013 + EXCLUDES:=$$($1_EXCLUDES), \ 1.1014 + EXCLUDE_FILES:=$$($1_EXCLUDE_FILES))) 1.1015 + endif 1.1016 1.1017 endef