# GNUstep Makefile

ADDITIONAL_CPP_FLAGS += -Wall -Wno-import -Wno-protocol -O2

libEOCoreData_INCLUDE_DIRS += -I..

ADDITIONAL_CPPFLAGS += -Wall -funsigned-char

libEOCoreData_LIBRARIES_DEPEND_UPON += -lEOControl
EOCoreData_LIBRARIES_DEPEND_UPON += -framework EOControl


# library/framework search pathes

DEP_DIRS = ../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 += -L/usr/local/lib -L/usr/lib


# libFoundation, gstep-base

ifeq ($(FOUNDATION_LIB),fd)
libEOCoreData_LIBRARIES_DEPEND_UPON += -lFoundation
endif

ifeq ($(FOUNDATION_LIB),gnu)
libEOCoreData_LIBRARIES_DEPEND_UPON += -lgnustep-base
endif

# Apple

ifeq ($(FOUNDATION_LIB),apple)

# TODO: libEOCoreData_PREBIND_ADDR="0xC1000000"
ifneq ($(libEOCoreData_PREBIND_ADDR),)
libEOCoreData_LDFLAGS += -seg1addr $(libEOCoreData_PREBIND_ADDR)
EOCoreData_LDFLAGS += -seg1addr $(libEOCoreData_PREBIND_ADDR)
endif

ADDITIONAL_LDFLAGS += -framework CoreData
endif

# Windows

ifeq ($(GNUSTEP_TARGET_OS),mingw32)
libEOCoreData_LIBRARIES_DEPEND_UPON += -lobjc
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin32)
libEOCoreData_LIBRARIES_DEPEND_UPON += -lobjc
endif