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

DEPTH=../../..
topsrcdir	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= @srcdir@

include $(DEPTH)/config/autoconf.mk

PROGRAM = xpviewer


TOOLKIT_GFX_LIB     = -lgfx$(MOZ_TOOLKIT)
TOOLKIT_WIDGET_LIB  = -lwidget$(MOZ_TOOLKIT)
TOOLKIT_BASE_LIB    = -lgmbase$(MOZ_TOOLKIT)

# Hardcoding dlopen()'s?  This needs to get fixed.
#
TOOLKIT_CFLAGS := \
	-DWIDGET_DLL=\"libwidget$(MOZ_TOOLKIT).$(DLL_SUFFIX)\" \
	-DGFXWIN_DLL=\"libgfx$(MOZ_TOOLKIT).$(DLL_SUFFIX)\" \
	$(TK_CFLAGS)


CPPSRCS = \
	nsFindDialog.cpp \
	nsSetupRegistry.cpp	\
	nsUnixStubs.cpp  		\
	nsBrowserWindow.cpp	\
	nsBrowserMain.cpp	\
	nsViewerApp.cpp		\
	nsXPBaseWindow.cpp \
	$(NULL)

ifdef MOZ_OJI
	JSJ_LIB = -ljsj
endif

LIBS := \
	-L$(DIST)/bin \
	-lraptorbase    \
	-lpref \
	-lraptorbase \
	$(TOOLKIT_WIDGET_LIB) \
	-lraptorgfx \
	$(TOOLKIT_GFX_LIB) \
	-lraptorhtml \
	$(DIST)/lib/libraptorhtmlforms_s.a \
	$(TOOLKIT_BASE_LIB) \
	-lraptorhtmlpars \
	-lraptorview \
	-lreg \
	-labouturl \
	-lfileurl \
	-lftpurl \
	-lgophurl \
	-lhttpurl \
	-lsockstuburl \
	-limg \
	$(JPEG_LIBS) \
	$(PNG_LIBS) \
	-ljs \
	-ljsdom \
	-ljsurl \
	$(DIST)/lib/libjsdomcore_s.a \
	$(JSJ_LIB) \
	-lmimetype \
	-lnetcache \
	-lnetcnvts \
	-lnetlib \
	-lnetutil \
	-lnetwork \
	-lpwcac \
	-lraptorwebwidget \
	-lreg \
	-lremoturl \
	-lsecfree \
	-lstubnj \
	-lstubsj \
	-ltestdynamic \
	-lmozutil \
	-lxp \
	-lxpcom \
	-lmozutil \
	-lxp \
	-lxpcom \
	$(ZLIB_LIBS) \
	-lraptorplugin \
	-lmozdbm \
	$(NULL)

include $(topsrcdir)/config/config.mk

CFLAGS += $(TOOLKIT_CFLAGS)

include $(topsrcdir)/config/rules.mk

install::
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test0.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test1.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test2.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test3.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test4.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test5.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test6.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test7.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test8.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test8siz.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test8sca.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test8tab.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test9.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test9a.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/test9b.html $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/raptor.jpg $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/Anieyes.gif $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/gear1.gif $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/rock_gra.gif $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/../../../webshell/tests/viewer/samples/bg.jpg $(DIST)/bin/res/samples
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation00.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation01.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation02.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation03.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation04.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation05.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation06.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation07.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation08.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation09.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation10.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation11.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation12.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation13.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation14.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation15.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation16.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation17.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation18.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation19.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation20.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation21.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation22.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation23.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation24.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation25.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation26.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation27.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation28.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation29.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation30.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation31.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation32.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation33.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation34.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation35.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation36.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation37.gif $(DIST)/bin/res/throbber
	$(INSTALL) $(srcdir)/resources/throbber/LargeAnimation38.gif $(DIST)/bin/res/throbber

	$(INSTALL) $(srcdir)/resources/toolbar/DialogAddrIcon.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/DialogAddrIcon_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/DialogCompIcon.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/DialogCompIcon_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/DialogMailIcon.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/DialogMailIcon_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/DialogNavIcon.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/DialogNavIcon_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Back.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Back_dis.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Back_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Bookmarks.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Bookmarks_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Edit.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Forward.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Forward_dis.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Forward_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Home.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Home_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_HTab.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_HTab_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_LoadImages.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_LoadImages.mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Location.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Location_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_MiniAddr.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_MiniComp.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_MiniMail.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_MiniNav.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_MiniTab.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_MixSecurity.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_MixSecurity.mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Netscape.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Netscape_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_PersonalIcon.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Places.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Places_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Print.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Print_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Reload.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Reload_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Search.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Search_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Secure.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Secure_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Stop.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Stop.mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Stop_dis.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Stop_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Tab.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_TabSmall.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_TabSmall_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Tab_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Unsecure.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_Unsecure.mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_WhatsRelated.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/TB_WhatsRelated_mo.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/StatusBar-insecure.gif $(DIST)/bin/res/toolbar
	$(INSTALL) $(srcdir)/resources/toolbar/StatusBar-secure.gif $(DIST)/bin/res/toolbar
