#!gmake
#
# 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=libfont 
JMC_GEN=Mcf Mcfb Mcfmi Mcrc Mcdoer 
JMC_GEN_FLAGS=-cimpl 
CPPSRCS=cdoer.cpp cf.cpp cfmi.cpp cfb.cpp crc.cpp f.cpp fmi.cpp fb.cpp \
    rc.cpp wfSzList.cpp wffpPeer.cpp wffpCat.cpp wfFCache.cpp wfList.cpp \
    wfMime.cpp wfStream.cpp wfMisc.cpp wfDlm.cpp 
CSRCS=libfont.c 
LIBRARY_NAME=font 
EXPORTS=nf.h coremem.h 
REQUIRES=libfont java jtools dbm nspr img layer util pref js htmldlgs \
    security 
JMC_HEADERS=$(JMC_GEN_DIR)\Mcf.h $(JMC_GEN_DIR)\Mcfb.h \
    $(JMC_GEN_DIR)\Mcfmi.h $(JMC_GEN_DIR)\Mcrc.h $(JMC_GEN_DIR)\Mcdoer.h 
JMC_STUBS=$(JMC_GEN_DIR)\Mcf.c $(JMC_GEN_DIR)\Mcfb.c \
    $(JMC_GEN_DIR)\Mcfmi.c $(JMC_GEN_DIR)\Mcrc.c $(JMC_GEN_DIR)\Mcdoer.c 
JMC_OBJS=.\$(OBJDIR)\Mcf.obj .\$(OBJDIR)\Mcfb.obj .\$(OBJDIR)\Mcfmi.obj \
    .\$(OBJDIR)\Mcrc.obj .\$(OBJDIR)\Mcdoer.obj 
C_OBJS=.\$(OBJDIR)\libfont.obj 
CPP_OBJS=.\$(OBJDIR)\cdoer.obj .\$(OBJDIR)\cf.obj .\$(OBJDIR)\cfmi.obj \
    .\$(OBJDIR)\cfb.obj .\$(OBJDIR)\crc.obj .\$(OBJDIR)\f.obj \
    .\$(OBJDIR)\fmi.obj .\$(OBJDIR)\fb.obj .\$(OBJDIR)\rc.obj \
    .\$(OBJDIR)\wfSzList.obj .\$(OBJDIR)\wffpPeer.obj \
    .\$(OBJDIR)\wffpCat.obj .\$(OBJDIR)\wfFCache.obj \
    .\$(OBJDIR)\wfList.obj .\$(OBJDIR)\wfMime.obj \
    .\$(OBJDIR)\wfStream.obj .\$(OBJDIR)\wfMisc.obj \
    .\$(OBJDIR)\wfDlm.obj 
!if "$(MOZ_BITS)" != "16"
LINCS=-I$(XPDIST)\public\libfont -I$(XPDIST)\public\java \
    -I$(XPDIST)\public\jtools -I$(XPDIST)\public\dbm \
    -I$(XPDIST)\public\nspr -I$(XPDIST)\public\img \
    -I$(XPDIST)\public\layer -I$(XPDIST)\public\util \
    -I$(XPDIST)\public\pref -I$(XPDIST)\public\js \
    -I$(XPDIST)\public\htmldlgs -I$(XPDIST)\public\security 
!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)/*.c to cwd
	-for %f in ($(LOCAL_JMC_SRC_SUBDIR)\*.c) do $(MAKE_INSTALL) %f .
!endif


$(JMC_GEN_DIR)\Mcf.h: $(JMCSRCDIR)\cf.class
    $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mcf.c: $(JMCSRCDIR)\cf.class
    $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mcfb.h: $(JMCSRCDIR)\cfb.class
    $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mcfb.c: $(JMCSRCDIR)\cfb.class
    $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mcfmi.h: $(JMCSRCDIR)\cfmi.class
    $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mcfmi.c: $(JMCSRCDIR)\cfmi.class
    $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mcrc.h: $(JMCSRCDIR)\crc.class
    $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mcrc.c: $(JMCSRCDIR)\crc.class
    $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mcdoer.h: $(JMCSRCDIR)\cdoer.class
    $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\Mcdoer.c: $(JMCSRCDIR)\cdoer.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)
	
