120 # If there are a lot of include patterns, output to file to shorten command lines |
120 # If there are a lot of include patterns, output to file to shorten command lines |
121 ifeq ($$(word 20,$$($1_GREP_INCLUDE_PATTERNS)),) |
121 ifeq ($$(word 20,$$($1_GREP_INCLUDE_PATTERNS)),) |
122 $1_GREP_INCLUDES:=| ( $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) \ |
122 $1_GREP_INCLUDES:=| ( $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) \ |
123 || test "$$$$?" = "1" ) |
123 || test "$$$$?" = "1" ) |
124 else |
124 else |
125 $1_GREP_INCLUDE_OUTPUT:=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include $$(NEWLINE) \ |
125 $1_GREP_INCLUDE_OUTPUT = \ |
126 $$(call ListPathsSafely,$1_GREP_INCLUDE_PATTERNS,\n, \ |
126 $$(eval $$(call ListPathsSafely,$1_GREP_INCLUDE_PATTERNS, \ |
127 >> $$($1_BIN)/_the.$$($1_JARNAME)_include) |
127 $$($1_BIN)/_the.$$($1_JARNAME)_include)) |
128 $1_GREP_INCLUDES:=| ( $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include \ |
128 $1_GREP_INCLUDES:=| ( $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include \ |
129 || test "$$$$?" = "1" ) |
129 || test "$$$$?" = "1" ) |
130 endif |
130 endif |
131 endif |
131 endif |
132 ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES)) |
132 ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES)) |
136 # If there are a lot of include patterns, output to file to shorten command lines |
136 # If there are a lot of include patterns, output to file to shorten command lines |
137 ifeq ($$(word 20,$$($1_GREP_EXCLUDE_PATTERNS)),) |
137 ifeq ($$(word 20,$$($1_GREP_EXCLUDE_PATTERNS)),) |
138 $1_GREP_EXCLUDES:=| ( $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) \ |
138 $1_GREP_EXCLUDES:=| ( $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) \ |
139 || test "$$$$?" = "1" ) |
139 || test "$$$$?" = "1" ) |
140 else |
140 else |
141 $1_GREP_EXCLUDE_OUTPUT=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_exclude $$(NEWLINE) \ |
141 $1_GREP_EXCLUDE_OUTPUT = \ |
142 $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS,\n, \ |
142 $$(eval $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS, \ |
143 >> $$($1_BIN)/_the.$$($1_JARNAME)_exclude) |
143 $$($1_BIN)/_the.$$($1_JARNAME)_exclude)) |
144 $1_GREP_EXCLUDES:=| ( $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude \ |
144 $1_GREP_EXCLUDES:=| ( $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude \ |
145 || test "$$$$?" = "1" ) |
145 || test "$$$$?" = "1" ) |
146 endif |
146 endif |
147 endif |
147 endif |
148 |
148 |
188 # them out to a separte file. Then process the contents of that file to rewrite |
188 # them out to a separte file. Then process the contents of that file to rewrite |
189 # into -C <dir> <file> lines. |
189 # into -C <dir> <file> lines. |
190 # The EXTRA_FILES_RESOLVED varible must be set in the macro so that it's evaluated |
190 # The EXTRA_FILES_RESOLVED varible must be set in the macro so that it's evaluated |
191 # in the recipe when the files are guaranteed to exist. |
191 # in the recipe when the files are guaranteed to exist. |
192 $1_CAPTURE_EXTRA_FILES=\ |
192 $1_CAPTURE_EXTRA_FILES=\ |
193 $(RM) $$($1_BIN)/_the.$$($1_JARNAME)_contents.extra $$(NEWLINE) \ |
193 $$(eval $1_EXTRA_FILES_RESOLVED:=$$(call DoubleDollar, \ |
194 $$(eval $1_EXTRA_FILES_RESOLVED:=$$(call DoubleDollar, $$(call DoubleDollar, \ |
|
195 $$(wildcard $$(foreach src, $$($1_SRCS), \ |
194 $$(wildcard $$(foreach src, $$($1_SRCS), \ |
196 $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES))))) \ |
195 $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES)))) \ |
197 $$(if $$($1_EXTRA_FILES_RESOLVED), \ |
196 $$(if $$($1_EXTRA_FILES_RESOLVED), \ |
198 $$(call ListPathsSafely,$1_EXTRA_FILES_RESOLVED,\n, \ |
197 $$(eval $$(call ListPathsSafely,$1_EXTRA_FILES_RESOLVED, \ |
199 >> $$($1_BIN)/_the.$$($1_JARNAME)_contents.extra) $$(NEWLINE) \ |
198 $$($1_BIN)/_the.$$($1_JARNAME)_contents.extra)) \ |
200 $(SED) $$(foreach src,$$($1_SRCS), -e 's|$$(src)/|-C $$(src) |g') \ |
199 $(SED) $$(foreach src,$$($1_SRCS), -e 's|$$(src)/|-C $$(src) |g') \ |
201 $$($1_BIN)/_the.$$($1_JARNAME)_contents.extra \ |
200 $$($1_BIN)/_the.$$($1_JARNAME)_contents.extra \ |
202 >> $$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)) |
201 >> $$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)) |
203 |
202 |
204 # The capture contents macro finds all files (matching the patterns, typically |
203 # The capture contents macro finds all files (matching the patterns, typically |
575 $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) |
574 $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) |
576 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps) |
575 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps) |
577 |
576 |
578 $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) |
577 $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) |
579 $(MKDIR) -p $$(@D) $$(dir $$($1_SJAVAC_PORTFILE)) |
578 $(MKDIR) -p $$(@D) $$(dir $$($1_SJAVAC_PORTFILE)) |
580 $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp) |
579 $$(eval $$(call ListPathsSafely,$1_SRCS, $$($1_BIN)/_the.$1_batch.tmp)) |
581 $(ECHO) Compiling $1 |
580 $(ECHO) Compiling $1 |
582 $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \ |
581 $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \ |
583 $$($1_JVM) $$($1_SJAVAC) \ |
582 $$($1_JVM) $$($1_SJAVAC) \ |
584 $$($1_REMOTE) \ |
583 $$($1_REMOTE) \ |
585 -j 1 \ |
584 -j 1 \ |
634 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps) |
633 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps) |
635 |
634 |
636 # When not using sjavac, pass along all sources to javac using an @file. |
635 # When not using sjavac, pass along all sources to javac using an @file. |
637 $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) |
636 $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) |
638 $(MKDIR) -p $$(@D) |
637 $(MKDIR) -p $$(@D) |
639 $(RM) $$($1_BIN)/_the.$1_batch $$($1_BIN)/_the.$1_batch.tmp |
638 $$(eval $$(call ListPathsSafely,$1_SRCS, $$($1_BIN)/_the.$1_batch.tmp)) |
640 $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp) |
|
641 $(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1 |
639 $(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1 |
642 $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \ |
640 $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \ |
643 $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \ |
641 $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \ |
644 -implicit:none \ |
642 -implicit:none \ |
645 -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.$1_batch.tmp) && \ |
643 -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.$1_batch.tmp) && \ |