make/common/JavaCompilation.gmk
changeset 30534 5e259b665bbf
parent 30095 0034766ccb09
child 31014 a3b1e5a584bd
equal deleted inserted replaced
30531:4915246064b2 30534:5e259b665bbf
     1 #
     1 #
     2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     5 # This code is free software; you can redistribute it and/or modify it
     6 # under the terms of the GNU General Public License version 2 only, as
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
   263     $1_JAR_CREATE_OPTIONS := cfm
   263     $1_JAR_CREATE_OPTIONS := cfm
   264     $1_JAR_UPDATE_OPTIONS := uf
   264     $1_JAR_UPDATE_OPTIONS := uf
   265   endif
   265   endif
   266 
   266 
   267   # Include all variables of significance in the vardeps file
   267   # Include all variables of significance in the vardeps file
   268   $1_VARDEPS := $(JAR) $$($1_JAR_CREATE_OPTIONS) $$($1_MANIFEST) $(RELEASE) $(COMPANY_NAME) \
   268   $1_VARDEPS := $(JAR) $$($1_JAR_CREATE_OPTIONS) $$($1_MANIFEST) \
   269       $$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR)
   269       $$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR)
   270   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps)
   270   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps)
   271 
   271 
   272   # Here is the rule that creates/updates the jar file.
   272   # Here is the rule that creates/updates the jar file.
   273   $$($1_JAR) : $$($1_DEPENDENCIES) $$($1_MANIFEST) $$($1_VARDEPS_FILE)
   273   $$($1_JAR) : $$($1_DEPENDENCIES) $$($1_MANIFEST) $$($1_VARDEPS_FILE)
   278         # either the jar file does not exist, or we need to recreate it from
   278         # either the jar file does not exist, or we need to recreate it from
   279         # from scratch anyway since a simple update will not catch all the
   279         # from scratch anyway since a simple update will not catch all the
   280         # potential changes.
   280         # potential changes.
   281 	$$(if $$(filter $$($1_VARDEPS_FILE) $$($1_MANIFEST), $$?), \
   281 	$$(if $$(filter $$($1_VARDEPS_FILE) $$($1_MANIFEST), $$?), \
   282 	  $$(if $$($1_MANIFEST), \
   282 	  $$(if $$($1_MANIFEST), \
   283 	    $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
   283 	    $(CP) $$($1_MANIFEST) $$($1_MANIFEST_FILE) $$(NEWLINE) \
   284 	        -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $$($1_MANIFEST) > $$($1_MANIFEST_FILE) $$(NEWLINE) \
       
   285 	  , \
   284 	  , \
   286 	    $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE) $$(NEWLINE)) \
   285 	    $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE) $$(NEWLINE)) \
   287 	  $$(if $$($1_JARMAIN), \
   286 	  $$(if $$($1_JARMAIN), \
   288 	    $(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
   287 	    $(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
   289 	  $$(if $$($1_EXTRA_MANIFEST_ATTR), \
   288 	  $$(if $$($1_EXTRA_MANIFEST_ATTR), \