< prev index next >

make/common/JavaCompilation.gmk

Print this page


   1 #
   2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   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
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 248         $$($1_BIN)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) )
 249   endif
 250   $1_SUPDATE_CONTENTS=$(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)
 251 
 252   # Use a slightly shorter name for logging, but with enough path to identify this jar.
 253   $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR))
 254 
 255   ifneq (,$$($1_CHECK_COMPRESS_JAR))
 256     $1_JAR_CREATE_OPTIONS := c0fm
 257     $1_JAR_UPDATE_OPTIONS := u0f
 258     ifeq ($(COMPRESS_JARS), true)
 259       $1_JAR_CREATE_OPTIONS := cfm
 260       $1_JAR_UPDATE_OPTIONS := uf
 261     endif
 262   else
 263     $1_JAR_CREATE_OPTIONS := cfm
 264     $1_JAR_UPDATE_OPTIONS := uf
 265   endif
 266 
 267   # Include all variables of significance in the vardeps file
 268   $1_VARDEPS := $(JAR) $$($1_JAR_CREATE_OPTIONS) $$($1_MANIFEST) $(RELEASE) $(COMPANY_NAME) \
 269       $$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR)
 270   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps)
 271 
 272   # Here is the rule that creates/updates the jar file.
 273   $$($1_JAR) : $$($1_DEPENDENCIES) $$($1_MANIFEST) $$($1_VARDEPS_FILE)
 274         $(MKDIR) -p $$($1_BIN)
 275         $$($1_GREP_INCLUDE_OUTPUT)
 276         $$($1_GREP_EXCLUDE_OUTPUT)
 277         # If the vardeps file is part of the newer prereq list, it means that
 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
 280         # potential changes.
 281         $$(if $$(filter $$($1_VARDEPS_FILE) $$($1_MANIFEST), $$?), \
 282           $$(if $$($1_MANIFEST), \
 283             $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
 284                 -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $$($1_MANIFEST) > $$($1_MANIFEST_FILE) $$(NEWLINE) \
 285           , \
 286             $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE) $$(NEWLINE)) \
 287           $$(if $$($1_JARMAIN), \
 288             $(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
 289           $$(if $$($1_EXTRA_MANIFEST_ATTR), \
 290             $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
 291           $(ECHO) Creating $$($1_NAME) $$(NEWLINE) \
 292           $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \
 293           $$($1_SCAPTURE_CONTENTS) \
 294           $$($1_SCAPTURE_METAINF) \
 295           $$($1_SUPDATE_CONTENTS) \
 296           $$($1_JARINDEX) && true \
 297         , \
 298           $(ECHO) Modifying $$($1_NAME) $$(NEWLINE) \
 299           $$($1_CAPTURE_CONTENTS) \
 300           $$($1_CAPTURE_METAINF) \
 301           $(RM) $$($1_DELETES_FILE) $$(NEWLINE) \
 302           $$($1_CAPTURE_DELETES) \
 303           $(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) $$(NEWLINE) \
 304           if [ -s $$($1_DELETESS_FILE) ]; then \


   1 #
   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.
   4 #
   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
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 248         $$($1_BIN)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) )
 249   endif
 250   $1_SUPDATE_CONTENTS=$(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)
 251 
 252   # Use a slightly shorter name for logging, but with enough path to identify this jar.
 253   $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR))
 254 
 255   ifneq (,$$($1_CHECK_COMPRESS_JAR))
 256     $1_JAR_CREATE_OPTIONS := c0fm
 257     $1_JAR_UPDATE_OPTIONS := u0f
 258     ifeq ($(COMPRESS_JARS), true)
 259       $1_JAR_CREATE_OPTIONS := cfm
 260       $1_JAR_UPDATE_OPTIONS := uf
 261     endif
 262   else
 263     $1_JAR_CREATE_OPTIONS := cfm
 264     $1_JAR_UPDATE_OPTIONS := uf
 265   endif
 266 
 267   # Include all variables of significance in the vardeps file
 268   $1_VARDEPS := $(JAR) $$($1_JAR_CREATE_OPTIONS) $$($1_MANIFEST) \
 269       $$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR)
 270   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps)
 271 
 272   # Here is the rule that creates/updates the jar file.
 273   $$($1_JAR) : $$($1_DEPENDENCIES) $$($1_MANIFEST) $$($1_VARDEPS_FILE)
 274         $(MKDIR) -p $$($1_BIN)
 275         $$($1_GREP_INCLUDE_OUTPUT)
 276         $$($1_GREP_EXCLUDE_OUTPUT)
 277         # If the vardeps file is part of the newer prereq list, it means that
 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
 280         # potential changes.
 281         $$(if $$(filter $$($1_VARDEPS_FILE) $$($1_MANIFEST), $$?), \
 282           $$(if $$($1_MANIFEST), \
 283             $(CP) $$($1_MANIFEST) $$($1_MANIFEST_FILE) $$(NEWLINE) \

 284           , \
 285             $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE) $$(NEWLINE)) \
 286           $$(if $$($1_JARMAIN), \
 287             $(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
 288           $$(if $$($1_EXTRA_MANIFEST_ATTR), \
 289             $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
 290           $(ECHO) Creating $$($1_NAME) $$(NEWLINE) \
 291           $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \
 292           $$($1_SCAPTURE_CONTENTS) \
 293           $$($1_SCAPTURE_METAINF) \
 294           $$($1_SUPDATE_CONTENTS) \
 295           $$($1_JARINDEX) && true \
 296         , \
 297           $(ECHO) Modifying $$($1_NAME) $$(NEWLINE) \
 298           $$($1_CAPTURE_CONTENTS) \
 299           $$($1_CAPTURE_METAINF) \
 300           $(RM) $$($1_DELETES_FILE) $$(NEWLINE) \
 301           $$($1_CAPTURE_DELETES) \
 302           $(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) $$(NEWLINE) \
 303           if [ -s $$($1_DELETESS_FILE) ]; then \


< prev index next >