# 
# GNUmakefile
#
# Copyright (C) 2003-2005 Helge Hess
#
# Author: Helge Hess (helge.hess@opengroupware.org)
#
# This file is part of the SQLite3 Adaptor Library
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; see the file COPYING.LIB.
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

SOPE_ROOT=../..

ifeq ($(frameworks),yes)
BUNDLE_INSTALL_DIR := $(FRAMEWORK_INSTALL_DIR)/GDLAccess.framework/Resources/GDLAdaptors/
else
BUNDLE_INSTALL_DIR = $(SOPE_DBADAPTORS)/
endif


MySQL_BUNDLE_LIBS += \
	-lGDLAccess	\
	$(shell mysql_config --libs)

MySQLD_BUNDLE_LIBS += \
	-lGDLAccess	\
	-lEOControl	\
	$(shell mysql_config --libs)

gdltest_TOOL_LIBS += \
	-lGDLAccess	\
	-lNGExtensions

# set compile flags and go

ADDITIONAL_CFLAGS += $(shell mysql_config --cflags)

ADDITIONAL_INCLUDE_DIRS += \
	-I../GDLAccess -I.. -I$(SOPE_ROOT)

ADDITIONAL_INCLUDE_DIRS += \
	-I$(SOPE_ROOT)/sope-core/		\
	-I$(SOPE_ROOT)/sope-core/NGExtensions   \
	$(shell mysql_config --include)


# dependencies


# library/framework search pathes

DEP_DIRS = \
	../GDLAccess \
	$(SOPE_ROOT)/sope-core/EOControl

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

SYSTEM_LIB_DIR += $(CONFIGURE_SYSTEM_LIB_DIR)
