1 #
   2 # Copyright (c) 2005, 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 
  27 LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS=1
  28 
  29 BUILDDIR = ../../../..
  30 PACKAGE = com.sun.tools.attach
  31 LIBRARY = attach
  32 PRODUCT = sun
  33 JAVAC_MAX_WARNINGS = true
  34 JAVAC_WARNINGS_FATAL = true
  35 
  36 include $(BUILDDIR)/common/Defs.gmk
  37 
  38 ifeq ($(PLATFORM), solaris)
  39 FILES_m = mapfile-solaris
  40 endif
  41 ifeq ($(PLATFORM), linux)
  42 FILES_m = mapfile-linux
  43 endif
  44 ifeq ($(PLATFORM), macosx)
  45 FILES_m = mapfile-bsd 
  46 endif
  47 include $(BUILDDIR)/common/Mapfile-vers.gmk
  48 
  49 #
  50 # Files to compile
  51 #
  52 include FILES_c.gmk
  53 include FILES_java.gmk
  54 include Exportedfiles.gmk
  55 
  56 ifeq ($(PLATFORM), solaris)
  57 OTHER_LDLIBS += -ldoor
  58 endif
  59 ifeq ($(PLATFORM), windows)
  60 EXTRA_LIBS += psapi.lib
  61 endif
  62 
  63 ifeq ($PLATFORM), macosx)
  64   vpath %.c $(call NativeSrcDirList,,native/sun/tools/attach)
  65 else
  66   vpath %.c $(PLATFORM_SRC)/native/sun/tools/attach
  67 endif
  68 
  69 all: classes copy-files
  70 
  71 #
  72 # Copy the service provider configuration files into the resource
  73 # directory. Copy the configuration file also uncomments any
  74 # providers that need to be enabled for this platform.
  75 #
  76                                                                                                 
  77 copy-files: $(FILES_copy)
  78                                                                                                 
  79 $(SERVICEDIR)/%: $(SHARE_SRC)/classes/sun/tools/attach/META-INF/services/%
  80         @$(MKDIR) -p $(@D)
  81         @$(RM) $@
  82         @$(CAT) $< | $(SED) -e "s/^#\[$(PLATFORM)\]//" > $@
  83 
  84 .PHONY: copy-files
  85 
  86 
  87 clean::
  88         $(RM) -r $(CLASSDESTDIR)/com/sun/tools/attach
  89         $(RM) -r $(CLASSDESTDIR)/sun/tools/attach
  90         $(RM) $(FILES_copy)
  91 
  92 #
  93 # Library to compile.
  94 #
  95 include $(BUILDDIR)/common/Library.gmk
  96 
  97 
  98 
  99 
 100 
 101