#############################################################################
#
# MODULE:   	Grass Compilation
#
#  trimmed down version for building external modules for Mac OS X GRASS.app
#  External modules shouldn't need all the dependency info, since they should
#  only be linking to GRASS libraries, or extra libraries configured in
#  their makefiles
#
#############################################################################

############################## Make Variables ###############################

CC                  = gcc
CXX                 = c++
LEX                 = flex
YACC                = bison -y
PERL                = /usr/bin/perl
AR                  = ar
RANLIB              = ranlib
MKDIR               = mkdir -p
CHMOD               = chmod
INSTALL             = /usr/bin/install -c 
INSTALL_DATA        = ${INSTALL} -m 644

ARCH                = apple-darwin
prefix              = /usr/local
exec_prefix         = ${prefix}
UNIX_BIN            = ${exec_prefix}/bin
INST_DIR            = @INSTALLDIR@
GRASSMANDIR         = ${prefix}/man

DL_LIBS             = 
DL_OBJS             = 
PLAT_OBJS           = 
STRIPFLAG           = 
CC_SEARCH_FLAGS     = 
LD_SEARCH_FLAGS     = 
LD_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH
LIB_RUNTIME_DIR     = $(ARCH_LIBDIR)

#static libs:
STLIB_LD            = ${AR} cr
STLIB_PREFIX        = lib
STLIB_SUFFIX        = .a

#shared libs
SHLIB_PREFIX        = lib
SHLIB_LD            = gcc -dynamiclib -compatibility_version ${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} -current_version ${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} -install_name ${INST_DIR}/lib/lib${LIB_NAME}${SHLIB_SUFFIX}
SHLIB_LD_EXTRAS     = 
SHLIB_LD_FLAGS      = 
SHLIB_LD_LIBS       = ${LIBS}
SHLIB_CFLAGS        = 
SHLIB_SUFFIX        = .dylib
EXE                 = 


# GRASS dirs
GRASS_HOME          = $(GRASS_HOME)
RUN_GISBASE         = $(GISBASE)

DEFAULT_DATABASE    =
DEFAULT_LOCATION    =

CPPFLAGS            = 
CFLAGS1             = -Os -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
CXXFLAGS1           = -Os -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
INCLUDE_DIRS        = 

COMPILE_FLAGS       = $(CPPFLAGS) $(CFLAGS1) $(INCLUDE_DIRS)
COMPILE_FLAGS_CXX   = $(CPPFLAGS) $(CXXFLAGS1) $(INCLUDE_DIRS)
LINK_FLAGS          = -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk

#Large File Support (LFS)
USE_LARGEFILES      = 1

#BSD sockets
HAVE_SOCKET         = 1

GDALCFLAGS          = @GDAL_CFLAGS@
PROJINC             = @PROJINC@ $(GDALCFLAGS)
