make/common/Defs.gmk
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File jdk Sdiff make/common

make/common/Defs.gmk

Print this page


   1 #
   2 # Copyright (c) 1995, 2011, 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


  92     else \
  93       echo false; \
  94     fi)
  95 endif
  96 
  97 # Set OPENJDK based on CLOSED_SRC_INCLUDED
  98 ifeq ($(CLOSED_SRC_INCLUDED), false)
  99   OPENJDK = true
 100 endif
 101 
 102 # Define where closed directories are
 103 ifdef OPENJDK
 104   CLOSED_SRC =
 105   CLOSED_SHARE_SRC =
 106 else
 107   ifndef CLOSED_SHARE_SRC
 108     CLOSED_SHARE_SRC    = $(CLOSED_SRC)/share
 109   endif
 110 endif
 111 




 112 #
 113 # Get platform definitions
 114 #
 115 
 116 include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk





 117 



 118 #
 119 # SE-Embedded support, if enabled
 120 #
 121 
 122 include $(JDK_TOPDIR)/make/common/Defs-embedded.gmk
 123 
 124 #
 125 # Cross-compilation Settings
 126 #
 127 ifdef CROSS_COMPILE_ARCH
 128   # Can't run the tools we just built
 129   USE_ONLY_BOOTDIR_TOOLS = true
 130 
 131   # When cross-compiling CC generates code for the target, but
 132   # some parts of the build generate C code that has to be compiled
 133   # and executed on the build host - HOST_CC is the 'local' compiler.
 134   # For linux the default is /usr/bin/gcc; other platforms need to
 135   # set it explicitly
 136   ifeq ($(PLATFORM), linux)
 137     ifndef HOST_CC
 138       HOST_CC = $(USRBIN_PATH)gcc
 139     endif
 140   endif
 141 else
 142   # Must set HOST_CC if not already set


 526 CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS)
 527 CPPFLAGS        = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
 528                   $(DEFINES) $(OPTIONS:%=-D%)
 529 LDFLAGS         = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
 530 LDLIBS          = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
 531 LINTFLAGS       = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
 532                   $(OTHER_LINTFLAGS)
 533 
 534 VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
 535 
 536 ifdef INSANE
 537   export INSANE
 538 endif
 539 
 540 ifdef ALT_COPYRIGHT_YEAR
 541   COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
 542 else
 543   COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
 544 endif
 545 
 546 ifndef OPENJDK
 547 include $(JDK_TOPDIR)/make/closed/common/Defs.gmk

 548 endif
 549 
 550 # Install of imported file (JDK_IMPORT_PATH, or some other external location)
 551 define install-importonly-file
 552 @$(ECHO) "ASSEMBLY_IMPORT: $@"
 553 $(prep-target)
 554 $(CP) $< $@
 555 @if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then     \
 556   if [ -x /usr/sbin/selinuxenabled ] ; then                         \
 557     /usr/sbin/selinuxenabled;                                       \
 558     if [ $$? = 0 ] ; then                                           \
 559       $(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@";               \
 560       /usr/bin/chcon -t textrel_shlib_t $@;                         \
 561       if [ $$? != 0 ]; then                                         \
 562         echo "ERROR: Cannot chcon $@";                              \
 563       fi;                                                           \
 564     fi;                                                             \
 565   fi;                                                               \
 566 fi
 567 endef
 568 
 569 define install-import-file
 570 $(install-importonly-file)
 571 endef
 572 




 573 .PHONY: all build clean clobber
   1 #
   2 # Copyright (c) 1995, 2012, 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


  92     else \
  93       echo false; \
  94     fi)
  95 endif
  96 
  97 # Set OPENJDK based on CLOSED_SRC_INCLUDED
  98 ifeq ($(CLOSED_SRC_INCLUDED), false)
  99   OPENJDK = true
 100 endif
 101 
 102 # Define where closed directories are
 103 ifdef OPENJDK
 104   CLOSED_SRC =
 105   CLOSED_SHARE_SRC =
 106 else
 107   ifndef CLOSED_SHARE_SRC
 108     CLOSED_SHARE_SRC    = $(CLOSED_SRC)/share
 109   endif
 110 endif
 111 
 112 # We allow for potential specialization of build files. This has to be
 113 # done on a file-by-file, case-by-case basis. Here we define the basic control
 114 # over where custom files are being used. Later we will include the custom
 115 # Defs.gmk if necessary. Other files can follow a similar pattern as needed.
 116 #
 117 # For non-OpenJDK builds the default location is the make/closed repository.
 118 # For OpenJDK builds a real value has to be supplied externally.
 119 
 120 ifneq ($(OPENJDK),true)
 121   CUSTOM_MAKE_DIR_REL=closed
 122 else
 123   CUSTOM_MAKE_DIR_REL=NO_SUCH_PATH
 124 endif
 125 CUSTOM_MAKE_DIR=$(BUILDDIR)/$(CUSTOM_MAKE_DIR_REL)
 126 
 127 # Use this variable to guard inclusion of the custom files
 128 HAS_CUSTOM_MAKE := $(shell if [ -d $(CUSTOM_MAKE_DIR) ]; then echo 1; else echo 0; fi)
 129 
 130 #
 131 # Get platform definitions
 132 #
 133 
 134 include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
 135 
 136 #
 137 # Cross-compilation Settings
 138 #
 139 ifdef CROSS_COMPILE_ARCH
 140   # Can't run the tools we just built
 141   USE_ONLY_BOOTDIR_TOOLS = true
 142 
 143   # When cross-compiling CC generates code for the target, but
 144   # some parts of the build generate C code that has to be compiled
 145   # and executed on the build host - HOST_CC is the 'local' compiler.
 146   # For linux the default is /usr/bin/gcc; other platforms need to
 147   # set it explicitly
 148   ifeq ($(PLATFORM), linux)
 149     ifndef HOST_CC
 150       HOST_CC = $(USRBIN_PATH)gcc
 151     endif
 152   endif
 153 else
 154   # Must set HOST_CC if not already set


 538 CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS)
 539 CPPFLAGS        = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
 540                   $(DEFINES) $(OPTIONS:%=-D%)
 541 LDFLAGS         = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
 542 LDLIBS          = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
 543 LINTFLAGS       = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
 544                   $(OTHER_LINTFLAGS)
 545 
 546 VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
 547 
 548 ifdef INSANE
 549   export INSANE
 550 endif
 551 
 552 ifdef ALT_COPYRIGHT_YEAR
 553   COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
 554 else
 555   COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
 556 endif
 557 
 558 # "Legacy" usage of the custom make repository
 559 ifeq ($(HAS_CUSTOM_MAKE),1)
 560   include $(CUSTOM_MAKE_DIR)/common/Defs.gmk
 561 endif
 562 
 563 # Install of imported file (JDK_IMPORT_PATH, or some other external location)
 564 define install-importonly-file
 565 @$(ECHO) "ASSEMBLY_IMPORT: $@"
 566 $(prep-target)
 567 $(CP) $< $@
 568 @if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then     \
 569   if [ -x /usr/sbin/selinuxenabled ] ; then                         \
 570     /usr/sbin/selinuxenabled;                                       \
 571     if [ $$? = 0 ] ; then                                           \
 572       $(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@";               \
 573       /usr/bin/chcon -t textrel_shlib_t $@;                         \
 574       if [ $$? != 0 ]; then                                         \
 575         echo "ERROR: Cannot chcon $@";                              \
 576       fi;                                                           \
 577     fi;                                                             \
 578   fi;                                                               \
 579 fi
 580 endef
 581 
 582 define install-import-file
 583 $(install-importonly-file)
 584 endef
 585 
 586 ifeq ($(HAS_CUSTOM_MAKE),1)
 587   include $(CUSTOM_MAKE_DIR)/Defs.gmk
 588 endif
 589 
 590 .PHONY: all build clean clobber
make/common/Defs.gmk
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File