1 #
   2 # Copyright (c) 2003, 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
  23 # questions.
  24 #
  25 
  26 LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS=1
  27 
  28 BUILDDIR = ../..
  29 PACKAGE = java.lang.management
  30 LIBRARY = management
  31 PRODUCT = java
  32 include $(BUILDDIR)/common/Defs.gmk
  33 
  34 MGMT_SRC  = $(SHARE_SRC)/classes/java/lang/management
  35 SMGMT_SRC = $(SHARE_SRC)/classes/sun/management
  36 
  37 AGENTJAR = $(LIBDIR)/management-agent.jar
  38 MANIFEST = $(SMGMT_SRC)/manifest
  39 
  40 #
  41 # Use mapfile
  42 #
  43 FILES_m = mapfile-vers
  44 include $(BUILDDIR)/common/Mapfile-vers.gmk
  45 
  46 #
  47 # Files to compile
  48 #
  49 include FILES_c.gmk
  50 
  51 # We don't need snmp here.
  52 AUTO_JAVA_PRUNE = snmp
  53 AUTO_FILES_JAVA_DIRS = java/lang/management com/sun/management sun/management
  54 
  55 include Exportedfiles.gmk
  56 
  57 ifeq ($(PLATFORM),windows)
  58 
  59 FILES_c     +=  OperatingSystem_md.c
  60 
  61 FILES_export += com/sun/management/OperatingSystem.java
  62 
  63 else # PLATFORM (i.e. solaris & linux)
  64 
  65 FILES_c     +=  UnixOperatingSystem_md.c
  66 
  67 FILES_export += com/sun/management/UnixOperatingSystem.java
  68 
  69 ifeq ($(PLATFORM),solaris)
  70 
  71 FILES_c     += SolarisOperatingSystem.c
  72 OTHER_LDLIBS += -lkstat
  73 
  74 endif # PLATFORM solaris
  75 
  76 ifeq ($(PLATFORM),linux)
  77 
  78 FILES_c     += LinuxOperatingSystem.c
  79 
  80 endif # PLATFORM linux
  81 
  82 ifeq ($(PLATFORM),macosx)
  83 
  84 FILES_c     += MacosxOperatingSystem.c
  85 
  86 endif # PLATFORM macosx
  87 
  88 endif # PLATFORM
  89 
  90 #
  91 # Resources
  92 #
  93 LOCALE_SET_DEFINITION = jre
  94 RESOURCE_BUNDLES_COMPILED_PROPERTIES = sun/management/resources/agent.properties
  95 
  96 #
  97 # Find C source files
  98 #
  99 vpath %.c $(SHARE_SRC)/native/sun/management
 100 vpath %.c $(PLATFORM_SRC)/native/sun/management
 101 vpath %.c $(PLATFORM_SRC)/native/com/sun/management
 102 
 103 #
 104 # Access to management.h 
 105 #
 106 
 107 OTHER_INCLUDES += \
 108   -I$(SHARE_SRC)/native/sun/management 
 109 
 110 ifeq ($(PLATFORM),windows)
 111   # Need process status helper API (psapi) on Windows
 112   OTHER_LDLIBS += $(JVMLIB) psapi.lib
 113 endif
 114 
 115 #
 116 # Library to compile.
 117 #
 118 include $(BUILDDIR)/common/Library.gmk
 119 
 120 $(AGENTJAR): $(LIBDIR) $(TEMPDIR)/manifest
 121         $(BOOT_JAR_CMD) -cfm $(AGENTJAR) $(TEMPDIR)/manifest $(BOOT_JAR_JFLAGS)
 122         @$(java-vm-cleanup)
 123 
 124 $(TEMPDIR)/manifest: $(MANIFEST)
 125         $(install-manifest-file)
 126 
 127 build: $(AGENTJAR)
 128 
 129 clean clobber::
 130         $(RM) -r $(CLASSDESTDIR)/java/management
 131         $(RM) -r $(CLASSDESTDIR)/sun/management
 132         $(RM) $(TEMPDIR)/manifest $(AGENTJAR)
 133