# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express oqr
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation.  Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): 
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU Public License (the "GPL"), in which case the
# provisions of the GPL are applicable instead of those above.
# If you wish to allow use of your version of this file only
# under the terms of the GPL and not to allow others to use your
# version of this file under the NPL, indicate your decision by
# deleting the provisions above and replace them with the notice
# and other provisions required by the GPL.  If you do not delete
# the provisions above, a recipient may use your version of this
# file under either the NPL or the GPL.



#//------------------------------------------------------------------------
#//
#// Makefile to build the Java reflections of JavaScript objects
#//
#//------------------------------------------------------------------------


#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH= ..\..\..
MODULE = java
REQUIRES	= xpcom \
		  js \
		  xpconnect \
		  $(NULL)
include <$(DEPTH)/config/config.mak>

!ifdef NSJVM
DIRS = classes
!endif


#//------------------------------------------------------------------------
#//
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
#//
#//------------------------------------------------------------------------
EXPORT_LIBRARY=1
LIBRARY_NAME=jsj$(MOZ_BITS)$(VERSION_NUMBER)
PDBFILE=$(LIBRARY_NAME).pdb
MAPFILE=$(LIBRARY_NAME).map

!if "$(MOZ_BITS)" == "16"
DEFFILE		= $(LIBRARY_NAME).def
!endif

LLIBS=$(LIBNSPR) $(DIST)\lib\js$(MOZ_BITS)$(VERSION_NUMBER).lib \
!ifdef MOZ_OJI
 $(DIST)\lib\xpcom.lib	\
!endif
    $(NULL)

#//------------------------------------------------------------------------
#// 
#// Define the files necessary to build the target (ie. OBJS)
#//
#//------------------------------------------------------------------------
OBJS=                                       \
    .\$(OBJDIR)\jsj.obj                     \
    .\$(OBJDIR)\jsj_JSObject.obj            \
    .\$(OBJDIR)\jsj_JavaArray.obj           \
    .\$(OBJDIR)\jsj_JavaClass.obj           \
    .\$(OBJDIR)\jsj_JavaMember.obj          \
    .\$(OBJDIR)\jsj_JavaObject.obj          \
    .\$(OBJDIR)\jsj_JavaPackage.obj         \
    .\$(OBJDIR)\jsj_array.obj               \
    .\$(OBJDIR)\jsj_class.obj               \
    .\$(OBJDIR)\jsj_convert.obj             \
    .\$(OBJDIR)\jsj_field.obj               \
    .\$(OBJDIR)\jsj_hash.obj                \
    .\$(OBJDIR)\jsj_method.obj              \
    .\$(OBJDIR)\jsj_utils.obj               \
!ifdef MOZ_OJI
    .\$(OBJDIR)\nsCLiveconnect.obj          \
    .\$(OBJDIR)\nsCLiveconnectFactory.obj   \
!endif
!if "$(MOZ_BITS)" == "16"
    .\$(OBJDIR)\jsj_nodl.obj                \
!endif
    $(NULL)

#//------------------------------------------------------------------------
#//
#// install headers
#//
#//------------------------------------------------------------------------
EXPORTS =	\
	jsjava.h \
!ifdef MOZ_OJI
 nsILiveconnect.h \
 nsISecureLiveconnect.h \
 nsISecurityContext.h \
!endif
  $(NULL)
#//------------------------------------------------------------------------
#//
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
#// (these must be defined before the common makefiles are included)
#//		  
#//------------------------------------------------------------------------

!ifdef NSJVM
JNI_GEN=                            \
        netscape.javascript.JSObject            \
        netscape.javascript.JSException         \
	$(NULL)

!endif

EXPORTS =	$(EXPORTS)			       \
	$(JNI_GEN_DIR)\netscape_javascript_JSObject.h    \
	$(NULL)


#//------------------------------------------------------------------------
#//
#// Define any local options for the make tools 
#//     (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
#//
#//------------------------------------------------------------------------

LINCS=$(LINCS) -I$(JNI_GEN_DIR) \
	$(NULL)


#!ifdef SERVER_BUILD
#LLIBS=$(DIST)/lib/httpdlw.lib $(DIST)/lib/libsjboot.lib
#!endif

#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)/config/rules.mak>

####
# this bit of extreme scariness came from the js/src makefile
#  reproduced here since that's where jsjava.c lives now...

!if ("$(MOZ_BITS)" == "16") 
#//
#// Win16 Hoovers SO BAD!!!   
#//

!if !defined(MOZ_DEBUG)
#//
#// We must turn off codeview debug info so jni.c can build.  
#// Otherwise the linker gives errors about data in the $SYMBOLS 
#// segment being beyond a segment boundary.
#//
$(OBJDIR)\jsjava.obj: jsjava.c
    @$(CC) @<<$(CFGFILE)
        -c 
        -Od 
        $(CFLAGS)
        $(LCFLAGS)
        $(LINCS) 
        $(LINCS_1) 
        $(INCS)
        -Fd$(PDBFILE)
        -Fo.\$(OBJDIR)\
        $(*B).c
<<KEEP
!endif
!endif
