make/common/JavaCompilation.gmk
Print this page
@@ -343,11 +343,12 @@
# Remove the source prefix.
$$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET)))
# Now we can setup the depency that will trigger the copying.
$$($1_BIN)$$($2_TARGET) : $2
$(MKDIR) -p $$(@D)
- $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
+ $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
+ -e 's/\([^\\]\)!/\1\\!/g' -e 's/#.*/#/g' \
| $(SED) -f "$(SRC_ROOT)/make/common/support/unicode2x.sed" \
| $(SED) -e '/^#/d' -e '/^$$$$/d' \
-e :a -e '/\\$$$$/N; s/\\\n//; ta' \
-e 's/^[ \t]*//;s/[ \t]*$$$$//' \
-e 's/\\=/=/' | LANG=C $(SORT) > $$@
@@ -374,12 +375,13 @@
# SRC:=one or more directories to search for sources
# BIN:=store classes here
# INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages.
# EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages.
# COPY:=.prp means copy all prp files to the corresponding package in BIN.
- # CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN.
# COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo
+ # CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN.
+ # 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
@@ -435,11 +437,11 @@
$1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
endif
# Find all files to be copied from source to bin.
- ifneq (,$$($1_COPY))
+ ifneq (,$$($1_COPY)$$($1_COPY_FILES))
# Search for all files to be copied.
$1_ALL_COPIES := $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS))
# Copy these explicitly
$1_ALL_COPIES += $$($1_COPY_FILES)
# Copy must also respect filters.
@@ -450,24 +452,26 @@
$1_ALL_COPIES := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_COPIES))
endif
ifneq (,$$($1_EXCLUDE_FILES))
$1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES))
endif
+ endif
# All files below META-INF are always copied.
$1_ALL_COPIES += $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS))
ifneq (,$$($1_ALL_COPIES))
# Yep, there are files to be copied!
$1_ALL_COPY_TARGETS:=
$$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files!
endif
- endif
# Find all property files to be copied and cleaned from source to bin.
- ifneq (,$$($1_CLEAN))
+ ifneq (,$$($1_CLEAN)$$($1_CLEAN_FILES))
# Search for all files to be copied.
$1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS))
+ # Clean these explicitly
+ $1_ALL_CLEANS += $$($1_CLEAN_FILES)
# Copy and clean must also respect filters.
ifneq (,$$($1_INCLUDES))
$1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS))
endif
ifneq (,$$($1_EXCLUDES))