1 #
   2 # Copyright (c) 1998, 2010, 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 # Makefile for building sun.rmi.*
  28 #
  29 
  30 BUILDDIR = ../../..
  31 MODULE  = rmi
  32 PACKAGE = sun.rmi
  33 PRODUCT = sun
  34 LIBRARY = rmi
  35 include $(BUILDDIR)/common/Defs.gmk
  36 
  37 #
  38 # Add use of a mapfile
  39 #
  40 FILES_m = mapfile-vers
  41 include $(BUILDDIR)/common/Mapfile-vers.gmk
  42 
  43 #
  44 # Java files to compile.
  45 #
  46 AUTO_FILES_JAVA_DIRS = \
  47         java/rmi \
  48         sun/rmi/log \
  49         sun/rmi/registry \
  50         sun/rmi/runtime \
  51         sun/rmi/server \
  52         sun/rmi/transport \
  53         com/sun/rmi
  54 
  55 #
  56 # Native files to compile.
  57 #
  58 FILES_c = \
  59         sun/rmi/server/MarshalInputStream.c
  60 
  61 #
  62 # Add ambient vpath to pick up files not part of sun.rmi package
  63 #
  64 vpath %.c $(SHARE_SRC)/native/sun/rmi/server
  65 
  66 #
  67 # Exported files that require generated .h 
  68 #
  69 FILES_export = \
  70     sun/rmi/server/MarshalInputStream.java
  71 
  72 #
  73 # Link to JVM for JVM_LatestUserDefinedLoader
  74 #
  75 OTHER_LDLIBS = $(JVMLIB)
  76 
  77 #
  78 # Rules
  79 #
  80 include $(BUILDDIR)/common/Library.gmk
  81 
  82 #
  83 # Full package names of implementations requiring stubs
  84 #
  85 REMOTE_impls = \
  86         sun.rmi.registry.RegistryImpl \
  87         sun.rmi.transport.DGCImpl
  88 
  89 ifeq ($(PLATFORM), windows)
  90 build: stubs
  91 else # PLATFORM
  92 ifneq ($(ARCH_DATA_MODEL), 32)
  93 build: stubs
  94 else # ARCH_DATA_MODEL
  95 build: stubs bin
  96 endif
  97 endif
  98 
  99 clean clobber:: bin.clean
 100 
 101 
 102 #
 103 # Compile stubs and skeletons for remote implementations
 104 # (use -v1.1 for backward interoperability)
 105 #
 106 #  gnumake 3.78.1 on windows attempts to build the target even
 107 #  though it exists. Not sure why, but a check for file existence
 108 #  has been added...
 109 #
 110 $(CLASSBINDIR)/%_Skel.class $(CLASSBINDIR)/%_Stub.class: $(CLASSBINDIR)/%.class
 111         if [ ! -s $@ ] ; \
 112         then $(RMIC) -v1.1 -classpath \
 113         "$(CLASSBINDIR)" \
 114         -d $(CLASSBINDIR) '$(subst /,.,$(<:$(CLASSBINDIR)/%.class=%))' ; \
 115         fi
 116         @$(java-vm-cleanup)
 117 
 118 REMOTE_files = $(subst .,/,$(REMOTE_impls))
 119 FILES_stubs  = $(REMOTE_files:%=$(CLASSBINDIR)/%_Stub.class)
 120 FILES_skels  = $(REMOTE_files:%=$(CLASSBINDIR)/%_Skel.class)
 121 
 122 stubs: $(FILES_stubs) $(FILES_skels)
 123 
 124 bin: $(BINDIR)/java-rmi.cgi
 125 
 126 $(BINDIR)/java-rmi.cgi: $(PLATFORM_SRC)/bin/java-rmi.cgi.sh
 127         $(install-file)
 128         $(call chmod-file, a+x)
 129 
 130 bin.clean:
 131         $(RM) $(BINDIR)/java-rmi.cgi
 132 
 133 .PHONY: stubs bin bin.clean
 134