< prev index next >
make/common/JavaCompilation.gmk
Print this page
*** 380,393 ****
define remove_string
$2 := $$(subst $1,,$$($2))
endef
- define replace_space_with_pathsep
- $1:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$2)))
- endef
-
# Setup make rules for compiling Java source code to class files and/or a
# resulting jar file.
#
# Parameter 1 is the name of the rule. This name is used as variable prefix,
# and the targets generated are listed in a variable by that name.
--- 380,389 ----
*** 406,417 ****
# CLEAN_FILES:=myapp/foo/setting.txt means clean this file over to the package myapp/foo
# SRCZIP:=Create a src.zip based on the found sources and copied files.
# INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file!
# EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file!
# "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found.
- # JAVAC_SOURCE_PATH_OVERRIDE:=This forces an explicit -sourcepath to javac instead of the complete
- # source roots from SRC. This is sometimes needed when compiling specific subsets of the source.
# HEADERS:=path to directory where all generated c-headers are written.
# DEPENDS:=Extra dependecy
# DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
define SetupJavaCompilation
$(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
--- 402,411 ----
*** 521,537 ****
$$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_clean,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files!
endif
endif
- # Prep the source paths.
- ifneq ($$($1_JAVAC_SOURCE_PATH_OVERRIDE),)
- $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_JAVAC_SOURCE_PATH_OVERRIDE)))
- else
- $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC)))
- endif
-
# Create a sed expression to remove the source roots and to replace / with .
# and remove .java at the end.
$1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes)
--- 515,524 ----
*** 610,620 ****
$(MKDIR) -p $$(@D)
$(RM) $$($1_BIN)/_the.$1_batch $$($1_BIN)/_the.$1_batch.tmp
$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp)
$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \
! -implicit:none -sourcepath "$$($1_SRCROOTSC)" \
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.$1_batch.tmp && \
$(MV) $$($1_BIN)/_the.$1_batch.tmp $$($1_BIN)/_the.$1_batch)
endif
--- 597,607 ----
$(MKDIR) -p $$(@D)
$(RM) $$($1_BIN)/_the.$1_batch $$($1_BIN)/_the.$1_batch.tmp
$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp)
$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \
! -implicit:none \
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.$1_batch.tmp && \
$(MV) $$($1_BIN)/_the.$1_batch.tmp $$($1_BIN)/_the.$1_batch)
endif
< prev index next >