# -*- Mode: Makefile -*-
#
# 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.

IGNORE_MANIFEST=1

# 

#
# JMC doesn't know to compile the generated C implementation files.
# Add those files to the list of objects.
#
OBJS = $(OBJS) $(JMC_OBJS)

DEPTH=..\..\..\..\.. 
MODULE=winfont 
CCJMC=1 
JMC_GEN=Mwinfp Mwinrf 
JMC_GEN_FLAGS=-cimpl 
CPPSRCS=winfp.cpp winrf.cpp 
LIBRARY_NAME=winfont 
EXPORTS=$(JMC_GEN_DIR)\Mwinfp.h 
REQUIRES=jtools nspr dbm libfont java 
JMC_HEADERS=$(JMC_GEN_DIR)\Mwinfp.h $(JMC_GEN_DIR)\Mwinrf.h 
JMC_STUBS=$(JMC_GEN_DIR)\Mwinfp.c $(JMC_GEN_DIR)\Mwinrf.c 
JMC_OBJS=.\$(OBJDIR)\Mwinfp.obj .\$(OBJDIR)\Mwinrf.obj 
CPP_OBJS=.\$(OBJDIR)\winfp.obj .\$(OBJDIR)\winrf.obj 
!if "$(MOZ_BITS)" != "16"
LINCS=-I$(XPDIST)\public\jtools -I$(XPDIST)\public\nspr \
    -I$(XPDIST)\public\dbm -I$(XPDIST)\public\libfont \
    -I$(XPDIST)\public\java 
!endif

!if !defined (MOZ_JAVA)
LOCAL_JMC_SUBDIR =  ..\..\..\jmcgen\include
LOCAL_JMC_SRC_SUBDIR =  ..\..\..\jmcgen\src
!endif

!include $(MOZ_SRC)\ns\config\rules.mak

!if !defined (MOZ_JAVA)
export:: 
	@echo +++ make:  Copying JMC src files from $(LOCAL_JMC_SRC_SUBDIR)/Mwin*.c to cwd
	-for %f in ($(LOCAL_JMC_SRC_SUBDIR)\Mwin*.c) do $(MAKE_INSTALL) %f .
!endif

$(JMC_GEN_DIR)\Mwinfp.h: $(JMCSRCDIR)\winfp.class
    $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mwinfp.c: $(JMCSRCDIR)\winfp.class
    $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mwinrf.h: $(JMCSRCDIR)\winrf.class
    $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mwinrf.c: $(JMCSRCDIR)\winrf.class
    $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)

#
# JMC doesn't include . and .\_jmc automatically. Hack that.
#
# 16 bit needs $(MOZ_SRC)\ns\dist\public\jtools to access jmc.h
CFLAGS = $(CFLAGS) -I. -I$(JMC_GEN_DIR) -I$(MOZ_SRC)\ns\dist\public\jtools

#
# JMC doesn't install the module library that we make on windows
# Hence we have our own rule to install the library.
#
MY_INSTALL_FILE_LIST = $(LIBRARY)
MY_INSTALL_DIR = $(DIST)\lib

install::
	!$(MAKE_INSTALL) $(MY_INSTALL_FILE_LIST) $(MY_INSTALL_DIR)
	
