# compile flags

SOPE_ROOT=../..

ADDITIONAL_CPPFLAGS += -Wall
ADDITIONAL_INCLUDE_DIRS += \
	-I.. -I$(SOPE_ROOT)			\
	-I../NGObjWeb			\
	-I$(SOPE_ROOT)/sope-core/NGStreams	\
	-I$(SOPE_ROOT)/sope-core/NGExtensions	\
	-I$(SOPE_ROOT)/sope-core		\
	-I$(SOPE_ROOT)/sope-xml


libWOExtensions_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
libWOExtensions_INSTALL_DIR=$(SOPE_SYSLIBDIR)
libWOExtensions_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION)


# dependencies

libWOExtensions_LIBRARIES_DEPEND_UPON += \
	-lNGObjWeb	\
	$(BASE_LIBS)

ifeq ($(frameworks),yes)
WOExtensions_LIBRARIES_DEPEND_UPON += \
	-framework WEExtensions	\
	-framework NGObjWeb	\
	-framework NGMime -framework NGMail \
	-framework NGStreams -framework NGExtensions -framework EOControl \
	-framework DOM -framework SaxObjC
endif


# library/framework search pathes

DEP_DIRS = \
	. \
	../WEExtensions \
	../NGObjWeb	\
	$(SOPE_ROOT)/sope-mime			\
	$(SOPE_ROOT)/sope-mime/NGMail		\
	$(SOPE_ROOT)/sope-core/NGStreams	\
	$(SOPE_ROOT)/sope-core/NGExtensions	\
	$(SOPE_ROOT)/sope-core/EOControl	\
	$(SOPE_ROOT)/sope-xml/DOM		\
	$(SOPE_ROOT)/sope-xml/SaxObjC

ifneq ($(frameworks),yes)
ADDITIONAL_LIB_DIRS += \
	$(foreach dir,$(DEP_DIRS),\
	  -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME))
else
ADDITIONAL_LIB_DIRS += \
	$(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir))
endif

ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64)
SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64
else
SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib
endif


# bundle dependencies

ifneq ($(frameworks),yes)

WOExtensions_BUNDLE_LIBS += \
	-lNGObjWeb	\
	-lWOExtensions -lWEExtensions \
	-lNGMime	\
	-lNGStreams -lNGExtensions -lEOControl \
	-lDOM -lSaxObjC
WOExtensions_WOBUNDLE_LIBS += $(WOExtensions_BUNDLE_LIBS)

endif


# Apple

ifeq ($(FOUNDATION_LIB),apple)
libWOExtensions_PREBIND_ADDR="0xC4300000"
libWOExtensions_LDFLAGS += -seg1addr $(libWOExtensions_PREBIND_ADDR)
endif
