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

#------------------------------------------------------------------------
#
# Makefile to build the IMGLIB LIB
#
#------------------------------------------------------------------------

!ifdef MOZ_JAVA
LOCAL_JMC_SUBDIR = .
!endif


#LIBRARY_NAME = img$(MOZ_BITS)
IMGSRC=	$(MOZ_SRC)\ns\modules\libimg\src\_jmc

#
# Make sure we have MOZILLA_CLIENT defined so we get the
#   proper JS includes
#
LCFLAGS		= $(LCFLAGS)  -DMOZILLA_CLIENT

!ifdef BUILD_DEBUG_GC
LCFLAGS		= $(LCFLAGS) -DDEBUG_GC
!endif

LLIBS=$(DIST)\lib\png.lib \
	$(NULL)
MISCDEP=$(LLIBS)
OBJS=.\$(OBJDIR)\MIMGCB.obj \
	$(NULL)

CSRCS =		   \
	_jmc\MIMGCB.c \
	$(NULL)


#LIBRARY= .\$(OBJDIR)\$(LIBNAME).lib
LIBRARY_SUFFIX = $(MOZ_BITS)


MODULE=img 
DEPTH=..\..\.. 
JMC_GEN=MIMGCB MPSIMGCB 
LOCAL_INCLUDES=-I../png -I. -I$(DEPTH)/dist/public/zlib 
JMC_GEN_FLAGS=-cimpl -noexc -module 
LIBRARY_NAME=img 
EXTRA_LIBS=$(DIST)/lib/libzlib.a $(DIST)/lib/libpng.a 
CSRCS=color.c colormap.c dither.c dummy_nc.c external.c gif.c if.c \
    ilclient.c il_util.c jpeg.c scale.c xbm.c ipng.c png_png.c 
REQUIRES=jtools java zlib nspr dbm jpeg util img png layer js 
EXPORTS=PIMGCB.h PPSIMGCB.h 
JMC_HEADERS=$(JMC_GEN_DIR)\MIMGCB.h $(JMC_GEN_DIR)\MPSIMGCB.h 
JMC_STUBS=$(JMC_GEN_DIR)\MIMGCB.c $(JMC_GEN_DIR)\MPSIMGCB.c 
JMC_OBJS=.\$(OBJDIR)\MIMGCB.obj .\$(OBJDIR)\MPSIMGCB.obj 
C_OBJS=.\$(OBJDIR)\color.obj .\$(OBJDIR)\colormap.obj \
    .\$(OBJDIR)\dither.obj .\$(OBJDIR)\dummy_nc.obj \
    .\$(OBJDIR)\external.obj .\$(OBJDIR)\gif.obj .\$(OBJDIR)\if.obj \
    .\$(OBJDIR)\ilclient.obj .\$(OBJDIR)\il_util.obj \
    .\$(OBJDIR)\jpeg.obj .\$(OBJDIR)\scale.obj .\$(OBJDIR)\xbm.obj \
    .\$(OBJDIR)\ipng.obj .\$(OBJDIR)\png_png.obj 
!if "$(MOZ_BITS)" != "16"
LINCS=-I$(XPDIST)\public\jtools -I$(XPDIST)\public\java \
    -I$(XPDIST)\public\zlib -I$(XPDIST)\public\nspr \
    -I$(XPDIST)\public\dbm -I$(XPDIST)\public\jpeg \
    -I$(XPDIST)\public\util -I$(XPDIST)\public\img \
    -I$(XPDIST)\public\png -I$(XPDIST)\public\layer \
    -I$(XPDIST)\public\js 
!endif

include <$(MOZ_SRC)\ns\config\rules.mak> 

$(JMC_GEN_DIR)\MIMGCB.h: $(JMCSRCDIR)\IMGCB.class
    $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\MIMGCB.c: $(JMCSRCDIR)\IMGCB.class
    $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\MPSIMGCB.h: $(JMCSRCDIR)\PSIMGCB.class
    $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
$(JMC_GEN_DIR)\MPSIMGCB.c: $(JMCSRCDIR)\PSIMGCB.class
    $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)

export:: $(LIBRARY)
    $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib

symbols::
	@echo "LIBRARY_NAME     is $(LIBRARY_NAME)"
	@echo "LIBRARY          is $(LIBRARY)"
