# This Makefile is for Mac OSX 10.3, Intel CPU with darwinports glib.
# Contributed by Jason W. Bacon, Medical College of Wisconsin.
# Do NOT use "cc -fast", since that produces incorrect code for 3dDeconvolve!
# The options below are supposed to be equivalent to "-fast".

USE_ZLIB = -DHAVE_ZLIB
LZLIB    = -lz

CC_Intel  = -march=pentium-m -mtune=prescott

CCDEBS = -DAFNI_DEBUG -DIMSEQ_DEBUG -DDISPLAY_DEBUG -DTHD_DEBUG
CEXTRA = -Wcomment -Wformat -DUSE_TRACING -DHAVE_XDBE -no-cpp-precomp \
       -DDONT_USE_MCW_MALLOC
CCFAST = cc $(CC_Intel) -DDARWIN  $(CEXTRA) -O3
CCVOL  = cc $(CC_Intel) -DDARWIN  $(CEXTRA) -O2
CC     = cc $(CC_Intel) -DDARWIN  $(CEXTRA) -O
CCMIN  = cc
CCD    = $(CC) $(CCDEBS)

IFLAGS = -I. -I/usr/X11R6/include -IopenMotif-2.2.3/lib -I/opt/local/include
LFLAGS = -L. -L/usr/X11R6/lib -Wl,-force_flat_namespace -L/opt/local/lib

CCSVD  = $(CCFAST)

PLUGIN_SUFFIX = so
PLUGIN_LFLAGS = -flat_namespace -bundle -undefined suppress
PLUGIN_CC     = $(CC) -dynamic -fno-common
PLFLAGS       = -dynamic -L. -L/usr/X11R6/lib -Wl,-force_flat_namespace -L/opt/local/lib

SPECIAL = -faltivec -framework Accelerate -DUSE_ALTIVEC

AR     = /usr/bin/ar
RANLIB = /usr/bin/ranlib
TAR    = /usr/bin/tar
MKDIR  = /bin/mkdir
GZIP   = /usr/bin/gzip
LD     = cc

RM = /bin/rm -f
MV = /bin/mv -f
CP = /bin/cp -f

LINT = /usr/bin/lint -a -b -u -v -x $(IFLAGS) $(CCDEFS)

INSTALLDIR = ./macosx_bin
LIBDIR = $(INSTALLDIR)

INSTALL_PREREQ = suma

LIBDL = libdl.a

# Hack for static openMotif to get around MacPorts openMotif-2.3, which
# breaks the plugins menu
LIBXM = openMotif-2.2.3/lib/Xm/.libs/libXm.a

# Return to this when MacPorts openMotif works with afni again
#LIBXM = -lXm

# for dynamic linking

LLIBS  = -lmri -lXp -lXpm -lXext -lXmu ${LIBXM} -lXt -lX11 -lm -lmri -ldl -lc $(LZLIB)

# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# For suma
SUMA_INCLUDE_PATH = -I/usr/X11R6/include -I./ -I../ -Igts/src -IopenMotif-2.2.3/lib -I/opt/local/include
SUMA_LINK_PATH = -L/usr/lib -L/usr/X11R6/lib -L../ -L/opt/local/lib
SUMA_LINK_LIB = -lGLw -lGLU -lGL -lXmu ${LIBXM} -lXp -lXt -lXext -lX11 -lmri -lm -lmx -lglib -bind_at_load $(LZLIB)
SUMA_MAKEFILE_NAME = SUMA_Makefile
SUMA_BIN_ARCHIVE = SUMA_MacOSX.tar

# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


###############################################################

MAKE = make
include Makefile.INCLUDE
