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

include $(DEPTH)/config/autoconf.mk

MODULE		= foo
XPIDL_MODULE	= foo
LIBRARY_NAME	= foo
SHORT_LIBNAME	= foo

IS_COMPONENT	= 1
MODULE_NAME	= foo

# Ensure that the xpcom classes that we build
# do not export themselves
DEFINES		+= -DMOZILLA_STRICT_API -DXPCOM_GLUE 


REQUIRES	= string \
		  xpcom \
		  $(NULL)

CPPSRCS		=		   \
		Foo.cpp	   \
		FooModule.cpp \
		$(NULL)

XPIDLSRCS	= Foo.idl

TESTCPPSRCS	= nsTestFoo.cpp

CPPSRCS		+= $(TESTCPPSRCS)

SIMPLE_PROGRAMS	= $(TESTCPPSRCS:.cpp=$(BIN_SUFFIX))

include $(topsrcdir)/config/config.mk

#EXTRA_COMPONENTS = Foo.js

# separate libraries linked in.
EXTRA_DSO_LDOPTS = \
		$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \
		$(NSPR_LIBS) \
		$(NULL)

LIBS            = \
		$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \
		$(NSPR_LIBS) \
		$(NULL)

# Needed to resolve __yylex (?)
ifeq ($(OS_ARCH)$(OS_RELEASE),FreeBSD2)
LIBS		+= -lpcap
endif

# Need to link with CoreFoundation on Mac
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += \
		$(TK_LIBS) \
		$(NULL)

LIBS += \
		$(TK_LIBS) \
		$(NULL)
endif

include $(topsrcdir)/config/rules.mk

libs:: $(TARGETS)
	$(INSTALL) $(srcdir)/xpconnect-sample.html $(DIST)/bin/res/samples

install:: $(TARGETS)
	$(SYSINSTALL) $(IFLAGS1) $(srcdir)/xpconnect-sample.html $(DESTDIR)$(mozappdir)/res/samples

