all: libfoo.so _xpidlgen/Foo.xpt

_xpidlgen:
	mkdir -p $@

.deps:
	mkdir -p $@
	echo "#define DEPENDENT_LIBS \"libplds4.so\", \"libplc4.so\", \"libnspr4.so\", \"libpthread.so\", \"libdl.so\", " > dependentLibs.h

export: 
	touch _export

libs:
	touch _libs

#INCLUDES = -I/usr/local/include/thunderbird-0.6+ -I/usr/local/include/thunderbird-0.6+/mailnews -I/usr/local/include/thunderbird-0.6+/xpcom_obsolete
INCLUDES = -I_xpidlgen -I../../dist/include/string -I../../dist/include/xpcom -I../../dist/include/xpcomsample -I../../dist/include -I/tmp/mozilla/dist/include/nspr     -I. -I/usr/X11R6/include -I/tmp/mozilla/dist/include/mailnews -I/tmp/mozilla/dist/include/xpcom_obsolete -I/tmp/mozilla/dist/include/necko

_xpidlgen/Foo.h : _xpidlgen Foo.idl
	/tmp/mozilla/dist/bin/xpidl -m header -w -I. -I../../dist/idl  -I /tmp/mozilla/mailnews/public -o _xpidlgen/Foo Foo.idl

Foo.o : Foo.cpp _xpidlgen/Foo.h fooImplementation.h .deps
	c++ -o Foo.o -c  -DOSTYPE=\"Linux2.6\" -DOSARCH=\"Linux\" -DHAVE_MOVEMAIL  -I_xpidlgen -I/tmp/mozilla/mailnews/local/src -I../../dist/include/xpcom -I../../dist/include/xpcom_obsolete -I../../dist/include/string -I../../dist/include/msgbase -I../../dist/include/msgbaseutil -I../../dist/include/mailnews -I../../dist/include/pref -I../../dist/include/necko -I../../dist/include/msgdb -I../../dist/include/rdf -I../../dist/include/intl -I../../dist/include/unicharutil -I../../dist/include/mime -I../../dist/include/dom -I../../dist/include/rdfutil -I../../dist/include/txmgr -I../../dist/include/caps -I../../dist/include/docshell -I../../dist/include/msgimap -I../../dist/include/nkcache -I../../dist/include/windowwatcher -I../../dist/include/msglocal -I../../dist/include -I/tmp/mozilla/dist/include/nspr     -I/usr/X11R6/include   -fPIC  -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe  -DDEBUG -D_DEBUG -DDEBUG_ekoontz -DTRACING -g -fno-inline -g  -I/usr/X11R6/include -DMOZILLA_CLIENT -include ../../../mozilla-config.h Foo.cpp

FooModule.o: FooModule.cpp .deps 
	c++ -o FooModule.o -c  -DOSTYPE=\"Linux2.6\" -DOSARCH=\"Linux\" -DHAVE_MOVEMAIL  -I_xpidlgen -I/tmp/mozilla/mailnews/local/src -I../../dist/include/xpcom -I../../dist/include/xpcom_obsolete -I../../dist/include/string -I../../dist/include/msgbase -I../../dist/include/msgbaseutil -I../../dist/include/mailnews -I../../dist/include/pref -I../../dist/include/necko -I../../dist/include/msgdb -I../../dist/include/rdf -I../../dist/include/intl -I../../dist/include/unicharutil -I../../dist/include/mime -I../../dist/include/dom -I../../dist/include/rdfutil -I../../dist/include/txmgr -I../../dist/include/caps -I../../dist/include/docshell -I../../dist/include/msgimap -I../../dist/include/nkcache -I../../dist/include/windowwatcher -I../../dist/include/msglocal -I../../dist/include -I/tmp/mozilla/dist/include/nspr     -I/usr/X11R6/include   -fPIC  -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe  -DDEBUG -D_DEBUG -DDEBUG_ekoontz -DTRACING -g -fno-inline -g  -I/usr/X11R6/include -DMOZILLA_CLIENT -include ../../../mozilla-config.h FooModule.cpp

nstestFoo.o : nsTestFoo.cpp .deps
	c++ -o nsTestFoo.o -c  -DMOZILLA_STRICT_API -DXPCOM_GLUE  -DOSTYPE=\"Linux2.6\" -DOSARCH=\"Linux\" -DHAVE_DEPENDENT_LIBS  -I../../dist/include/string -I../../dist/include/xpcom -I../../dist/include/foo -I../../dist/include -I/tmp/mozilla/dist/include/nspr     -I. -I/usr/X11R6/include   -fPIC  -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe  -DDEBUG -D_DEBUG -DDEBUG_ekoontz -DTRACING -g -fno-inline -g  -I/usr/X11R6/include -DMOZILLA_CLIENT -include ../../mozilla-config.h -Wp,-MD,.deps/nsTestFoo.pp $<

libfoo.so: Foo.o FooModule.o Makefile
	c++ -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe  -DDEBUG-D_DEBUG -DDEBUG_ekoontz -DTRACING -g -fno-inline -g -fPIC -shared -Wl,-h -Wl,libfoo.so -o $@ Foo.o FooModule.o -Wl,--whole-archive ../../dist/lib/libmsgbsutl_s.a ../../dist/lib/libmsgbase_s.a ../../dist/lib/libmsgsearch_s.a ../../dist/lib/libmsglocal_s.a ../../dist/lib/libmsgcompose_s.a ../../dist/lib/libmsgdb_s.a -Wl,--no-whole-archive -L../../dist/bin -L../../dist/lib -lrdfutil_s -L../../dist/bin -lmozjs ../../dist/lib/libunicharutil_s.a -L../../dist/bin -lxpcom -lxpcom_core  -L../../dist/bin -L/tmp/mozilla/dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl  -L../../dist/lib -lxpcom_compat   -Wl,-Bsymbolic -ldl -lm

_xpidlgen/Foo.xpt: _xpidlgen Foo.idl
	../../dist/bin/xpidl -m typelib -w -I ../../dist/idl -I. -o _xpidlgen/Foo Foo.idl
	../../dist/bin/xpt_link _xpidlgen/foo.xpt _xpidlgen/Foo.xpt 

install: libfoo.so _xpidlgen/Foo.xpt
	/tmp/mozilla/config/nsinstall -R -m 755 libfoo.so /usr/local/lib/thunderbird-0.6+/components
	/tmp/mozilla/config/nsinstall -R -m 644 _xpidlgen/foo.xpt /usr/local/lib/thunderbird-0.6+/components

#install:
#	touch _install

clean:
	rm -f .md  .bak core     Templates.DB  nsTestFoo.o dependentLibs.h  libfoo.so  nsTestFoo    Foo.o FooModule.o nsTestFoo.o Foo.o FooModule.o nsTestFoo.o LOGS TAGS a.out      so_locations _gen _stubs       libfoo.exp   nsTestFoo.exp  nsTestFoo.lib nsTestFoo.o  
	rm -rf .deps _xpidlgen _xpidlgen /no-such-file
