8012566: Replace find, rm, printf and similar with their proper variables

Tue, 28 May 2013 08:49:04 +0200

author
erikj
date
Tue, 28 May 2013 08:49:04 +0200
changeset 1766
58eace4d997f
parent 1764
997c0fae2b12
child 1767
3597773628a4

8012566: Replace find, rm, printf and similar with their proper variables
Reviewed-by: tbell

makefiles/BuildLangtools.gmk file | annotate | diff | comparison | revisions
     1.1 --- a/makefiles/BuildLangtools.gmk	Fri May 17 10:13:34 2013 -0700
     1.2 +++ b/makefiles/BuildLangtools.gmk	Tue May 28 08:49:04 2013 +0200
     1.3 @@ -56,7 +56,7 @@
     1.4  # The compileprops tools compiles a properties file into a resource bundle.
     1.5  TOOL_COMPILEPROPS_CMD:=$(JAVA) -cp $(LANGTOOLS_OUTPUTDIR)/btclasses compileproperties.CompileProperties -quiet
     1.6  # Lookup the properties that need to be compiled into resource bundles.
     1.7 -PROPSOURCES:=$(shell find $(LANGTOOLS_TOPDIR)/src/share/classes -name "*.properties")
     1.8 +PROPSOURCES:=$(shell $(FIND) $(LANGTOOLS_TOPDIR)/src/share/classes -name "*.properties")
     1.9  # Strip away prefix and suffix, leaving for example only: "com/sun/tools/javac/resources/javac_zh_CN"
    1.10  PROPPATHS:=$(patsubst $(LANGTOOLS_TOPDIR)/src/share/classes/%.properties,%,$(PROPSOURCES))
    1.11  # Generate the list of java files to be created.
    1.12 @@ -70,13 +70,13 @@
    1.13  
    1.14  # Now setup the rule for the generation of the resource bundles.
    1.15  $(LANGTOOLS_OUTPUTDIR)/gensrc/_the_props.d : $(PROPSOURCES) $(BUILD_TOOLS)
    1.16 -	rm -rf $(@D)/*
    1.17 -	mkdir -p $(@D) $(PROPDIRS)
    1.18 -	printf "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javah/resources/version.properties
    1.19 -	printf "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javap/resources/version.properties
    1.20 -	printf "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javac/resources/version.properties
    1.21 -	printf "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.properties
    1.22 -	echo Compiling $(words $(PROPSOURCES) v1 v2 v3) properties into resource bundles
    1.23 +	$(RM) -r $(@D)/*
    1.24 +	$(MKDIR) -p $(@D) $(PROPDIRS)
    1.25 +	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javah/resources/version.properties
    1.26 +	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javap/resources/version.properties
    1.27 +	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javac/resources/version.properties
    1.28 +	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.properties
    1.29 +	$(ECHO) Compiling $(words $(PROPSOURCES) v1 v2 v3) properties into resource bundles
    1.30  	$(TOOL_COMPILEPROPS_CMD) $(PROPCMDLINE) \
    1.31  		-compile 	$(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javah/resources/version.properties \
    1.32  				$(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javah/resources/version.java \
    1.33 @@ -90,7 +90,7 @@
    1.34  		-compile	$(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.properties \
    1.35  				$(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.java \
    1.36  				java.util.ListResourceBundle
    1.37 -	echo PROPS_ARE_CREATED=yes > $@
    1.38 +	$(ECHO) PROPS_ARE_CREATED=yes > $@
    1.39  
    1.40  # Trigger the generation of the resource bundles. After the resource bundles have
    1.41  # been compiled, then the makefile will restart and the newly created java files
    1.42 @@ -134,19 +134,19 @@
    1.43          $(LANGTOOLS_OUTPUTDIR)/genstubs/_the_stubs.d : $(STUBSOURCES) $(BUILD_TOOLS) \
    1.44  				$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
    1.45  				$(LANGTOOLS_OUTPUTDIR)/gensrc/_the_props.d
    1.46 -	       	mkdir -p $(@D)
    1.47 -		mkdir -p $(LANGTOOLS_OUTPUTDIR)/tmpstubs
    1.48 -	       	echo $(LOG_INFO) Generating stubs from JDK sources.
    1.49 -	       	($(TOOL_GENSTUBS_CMD) -s $(LANGTOOLS_OUTPUTDIR)/tmpstubs -sourcepath $(JDKS) $(STUBCLASSES) && echo STUBS_ARE_CREATED=yes > $@)
    1.50 +	       	$(MKDIR) -p $(@D)
    1.51 +		$(MKDIR) -p $(LANGTOOLS_OUTPUTDIR)/tmpstubs
    1.52 +	       	$(ECHO) $(LOG_INFO) Generating stubs from JDK sources.
    1.53 +	       	($(TOOL_GENSTUBS_CMD) -s $(LANGTOOLS_OUTPUTDIR)/tmpstubs -sourcepath $(JDKS) $(STUBCLASSES) && $(ECHO) STUBS_ARE_CREATED=yes > $@)
    1.54  		if $(DIFF) -x "_the*" -rq $(LANGTOOLS_OUTPUTDIR)/tmpstubs $(LANGTOOLS_OUTPUTDIR)/genstubs > /dev/null 2>&1; then \
    1.55 -			echo $(LOG_INFO) No changes in the stubs!; \
    1.56 -			rm -rf $(LANGTOOLS_OUTPUTDIR)/tmpstubs; \
    1.57 +			$(ECHO) $(LOG_INFO) No changes in the stubs!; \
    1.58 +			$(RM) -r $(LANGTOOLS_OUTPUTDIR)/tmpstubs; \
    1.59  		else \
    1.60 -			echo $(LOG_INFO) Changes in stubs detected!; \
    1.61 -			rm -rf $(@D); \
    1.62 -			mv $(LANGTOOLS_OUTPUTDIR)/tmpstubs $(@D); \
    1.63 +			$(ECHO) $(LOG_INFO) Changes in stubs detected!; \
    1.64 +			$(RM) -r $(@D); \
    1.65 +			$(MV) $(LANGTOOLS_OUTPUTDIR)/tmpstubs $(@D); \
    1.66  		fi
    1.67 -		echo STUBS_ARE_CREATED=yes > $@
    1.68 +		$(ECHO) STUBS_ARE_CREATED=yes > $@
    1.69  
    1.70          # Trigger a generation of the genstubs java source code and a restart
    1.71          # of the makefile to make sure that the following build setup use the 

mercurial