# 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.

VERBOSE=1
IGNORE_MANIFEST=1
DEPTH=..\..\..\..\.. 
DIRS=JRI

!ifdef MOZ_PRIV
PRIVDIR=$(DEPTH)\..\ns_priv\dialup\win\rsa
!endif

# Get CFLAGS, OBJDIR and such defined before using them in this makefile...
!include "$(DEPTH)\config\config.mak"

#################################################################

# included ns\lib\plugin to get npupp.h; npupp.h should really be in ns\include...
INCS= \
	-I. -I..\include \
	-I$(MOZ_SRC)\ns\dist\public\java \
	-I$(MOZ_SRC)\ns\dist\public\nspr \
!ifdef MOZ_PRIV
	-I$(PRIVDIR) \
	-I$(PRIVDIR)\..\..\shiva \
!endif
	-I$(MOZ_SRC)\ns\lib\plugin \
	$(INCS)

# Do NOT define these, they're not necessary
#	-DIMPLEMENT_netscape_plugin_Plugin
#	-DIMPLEMENT_java_lang_String
#
# Defining NO_JDK for SetupPlugin prevents necessary things from being emitted
#	-DNO_JDK
#
CFLAGS= \
	-DASW_PLUGIN \
	-DJRI_NO_CPLUSPLUS \
	-DIMPLEMENT_netscape_npasw_SetupPlugin \
	$(CFLAGS)

!if "$(MOZ_BITS)" == "16"
OBJS=.\$(OBJDIR)\asw16.res
RCFLAGS = -I..\include $(RCFLAGS)
!else
OBJS=.\$(OBJDIR)\plugn32.res
!endif

# java_lang_String is in a wrapper because it MUST have NO_JDK defined (see above)
#	.\$(OBJDIR)\java_lang_String.obj \
C_OBJS=.\$(OBJDIR)\netscape_npasw_SetupPlugin.obj \
	.\$(OBJDIR)\jlStringWrapper.obj \
	.\$(OBJDIR)\netscape_plugin_Plugin.obj \
!ifdef MOZ_PRIV
	.\$(OBJDIR)\algrc4.obj \
	.\$(OBJDIR)\pwddcrpt.obj \
!endif
	$(NULL)

CPP_OBJS=.\$(OBJDIR)\winplugn.obj \
	.\$(OBJDIR)\deskcnfg.obj \
	.\$(OBJDIR)\dialer.obj \
	.\$(OBJDIR)\errmsg.obj \
	.\$(OBJDIR)\fileio.obj \
	.\$(OBJDIR)\mdmwiz.obj \
	.\$(OBJDIR)\npwin.obj \
	.\$(OBJDIR)\sysnregi.obj \
	.\$(OBJDIR)\rassize.obj \
	.\$(OBJDIR)\profile.obj \
!if "$(MOZ_BITS)" == "16"
	.\$(OBJDIR)\helper.obj \
	.\$(OBJDIR)\nodl.obj \
!else
	.\$(OBJDIR)\rasnt40.obj \
	.\$(OBJDIR)\ckdnsdun.obj \
	.\$(OBJDIR)\location.obj \
!endif
	$(NULL)

#################################################################

MAKE_OBJ_TYPE=DLL
LIBNAME = np$(MOZ_BITS)asw
PDBFILE	= $(LIBNAME).pdb

#make link shut up about this...
LFLAGS=/MACHINE:Ix86 $(LFLAGS)

!if "$(MOZ_BITS)" == "16"
DEFFILE = asw16.def
DLL_LIBS=winsock \
	oldnames \
	libw \
	ldllcew \
	commdlg.lib \
	ddeml.lib \
	olecli.lib \
	olesvr.lib \
	shell.lib\
	$(DLL_LIBS)
!else
DEFFILE = plugn32.def
DLL_LIBS=mapi32.lib \
	rasapi32.lib \
	tapi32.lib \
	shell32.lib \
	comdlg32.lib \
	uuid.lib \
	ole32.lib \
	$(DLL_LIBS)
!endif

DLL     = .\$(OBJDIR)\$(LIBNAME).dll

#################################################################

!include "$(DEPTH)\config\rules.mak"

# Stupid rules.mak doesn't automatically build DLLs
all:: $(DLL)

install::
	$(MAKE_INSTALL) .\$(OBJDIR)\$(LIBNAME).dll $(DIST)\lib
