#// The contents of this file are subject to the Netscape Public License
#// Version 1.0 (the "NPL"); you may not use this file except in
#// compliance with the NPL.  You may obtain a copy of the NPL at
#// http://www.mozilla.org/NPL/
#//
#// Software distributed under the NPL is distributed on an "AS IS" basis,
#// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
#// for the specific language governing rights and limitations under the
#// NPL.
#//
#// The Initial Developer of this code under the NPL is Netscape
#// Communications Corporation.  Portions created by Netscape are
#// Copyright (C) 1998 Netscape Communications Corporation.  All Rights
#// Reserved.

#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH=..\..

#//------------------------------------------------------------------------
#//
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
#//
#//------------------------------------------------------------------------

DLLNAME		= js$(MOZ_BITS)$(VERSION_NUMBER)
DLL1NAME	= js1$(MOZ_BITS)$(VERSION_NUMBER)
PDBFILE		= $(DLLNAME).pdb
MAPFILE		= $(DLLNAME).map
RESFILE		= $(DLLNAME).res
DLL		=.\$(OBJDIR)\$(DLLNAME).dll
MAKE_OBJ_TYPE	= DLL

!if "$(MOZ_BITS)" != "16"
LINCS = -I$(PUBLIC)\layout \
        -I$(DEPTH)\include \
        -I$(PUBLIC)\liblayer 
!endif

!if "$(MOZ_BITS)" == "16"
!ifdef NSPR20
DEFFILE		= $(DLL1NAME).def
!else
DEFFILE		= $(DLLNAME).def
!endif
!endif

LLIBS=$(LIBNSPR)
LCFLAGS= $(LCFLAGS) -DEXPORT_JS_API

#//------------------------------------------------------------------------
#// 
#// Define the files necessary to build the target (ie. OBJS)
#//
#//------------------------------------------------------------------------
OBJS =					\
	.\$(OBJDIR)\jsapi.obj		\
	.\$(OBJDIR)\prmjtime.obj	\
	.\$(OBJDIR)\jsarray.obj		\
	.\$(OBJDIR)\jsatom.obj		\
	.\$(OBJDIR)\jsbool.obj		\
	.\$(OBJDIR)\jscntxt.obj		\
	.\$(OBJDIR)\jsdate.obj		\
	.\$(OBJDIR)\jsdbgapi.obj	\
	.\$(OBJDIR)\jsemit.obj		\
	.\$(OBJDIR)\jsfun.obj		\
	.\$(OBJDIR)\jsgc.obj		\
	.\$(OBJDIR)\jsinterp.obj	\
	.\$(OBJDIR)\jslock.obj		\
	.\$(OBJDIR)\jsmath.obj		\
	.\$(OBJDIR)\jsnum.obj		\
	.\$(OBJDIR)\jsobj.obj		\
	.\$(OBJDIR)\jsopcode.obj	\
	.\$(OBJDIR)\jsparse.obj		\
	.\$(OBJDIR)\jsregexp.obj	\
	.\$(OBJDIR)\jsscan.obj		\
	.\$(OBJDIR)\jsscope.obj		\
	.\$(OBJDIR)\jsscript.obj	\
	.\$(OBJDIR)\jsstr.obj		\
	.\$(OBJDIR)\jsxdrapi.obj	\
	$(NULL)

#//------------------------------------------------------------------------
#//
#// install headers
#//
#//------------------------------------------------------------------------
INSTALL_DIR=$(PUBLIC)\js
INSTALL_FILE_LIST=	\
	jsapi.h		\
	jsarray.h	\
	jsatom.h	\
	jsbool.h	\
	jscntxt.h	\
	jscompat.h	\
	jsconfig.h	\
	jsdate.h	\
	jsdbgapi.h	\
	jsemit.h	\
	jsfun.h		\
	jsgc.h		\
	jsinterp.h	\
	jslock.h	\
	jsmath.h	\
	jsnum.h		\
	jsobj.h		\
	jsopcode.def	\
	jsopcode.h	\
	jsparse.h	\
	jsprvtd.h	\
	jspubtd.h	\
	jsregexp.h	\
	jsscan.h	\
	jsscope.h	\
	jsscript.h	\
	jsstr.h		\
	$(NULL)

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

export:: $(DLL)	INSTALL_FILES
	$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
	$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib

#//------------------------------------------------------------------------
#//
#// Standalone js.exe interpreter
#//
#//------------------------------------------------------------------------

#//PROGRAM = $(OBJDIR)\js.exe
#//js:	$(PROGRAM)
#//
#//$(PROGRAM): $(OBJDIR)\js.obj $(LIBRARY)
#//	    @$(MAKE_OBJDIR)
#//	    $(link) /debug /out:$(PROGRAM) $(OBJDIR)\js.obj $(DIST)\lib\pr3240.lib $(LIBRARY) $(LDFLAGS)
#//
#//$(OBJDIR)\js.obj: js.c
#//		$(CC) /Fo$(OBJDIR)\js.obj js.c $(CFLAGS) -DJSFILE
