#
# Darwin - g++ (for g++ version 2.x)
#

#
# Check JDK_HOME is set
#
ifndef JDK_HOME
	JDK_HOME = /Library/Java/Home
endif

ARCH = mac

#
# Compiler
#
ifneq ($(DEBUG),)
	DEBUGSUFFIX =
	CFLAGS += -g
else
	DEBUGSUFFIX =
	CFLAGS += -O
endif

F77 = g772
F77FLAGS += -O99 -c
F77TARGET = -o # leave the space!
CXX = g++2
CC = gcc2
CFLAGS += -c -Wall -Wno-long-long -Wpointer-arith -Wconversion -pipe -DGNU_GCC -fPIC -Df2cFortran
CCFLAGS += -Wnested-externs -Wbad-function-cast
CXXFLAGS += -Woverloaded-virtual
CXXFLAGS += -I$(FREEHEP)/org/freehep/zip/g++iostream
CXXTARGET = -o # leave the space!
ifneq ($(LINKNOCXX),)
	# will not link to ___gxx_personality_v0
	CFLAGS += -fno-exceptions
endif   # LINKNOCXX

#
# Librarian
#
LIB = libtool
LIBTARGET = -o # leave the space!

#
# Linker
#
LINK = $(CXX) -dynamic
LINKCC = $(CC) -dynamic
DLLFLAGS += -bundle
ifeq ($(LINKNOJAVA),)
	LINKLIBS += -framework JavaVM
endif   # LINKNOJAVA

ifeq ($(LINKNOCXX),)
	LINKLIBS += -lstdc++
endif   # LINKNOCXX


#
# CERN Lib
#
ifneq ($(CERN_ROOT),)
	LINKLIBS += `cernlib packlib geant`
endif   # CERN_ROOT

#
# Generic Unix
#
LINKFLAGS += $(addsuffix  /$(REF), $(addprefix -L, $(EXTLIBDIRS)))
LINKFLAGS += $(addsuffix  /$(DST), $(addprefix -L, $(LIBDIRS)))
LINKFLAGS += $(addprefix -L, $(UNIXLIBDIRS))
LINKLIBS += $(addsuffix $(DEBUGSUFFIX), $(addprefix -l, $(INCLUDELIBS)))
LINKLIBS += $(addsuffix $(DEBUGSUFFIX), $(addprefix -l, $(INCLUDEUNIXLIBS)))

LINKTARGET = -o # leave ths space
DLL = ld

#
# Extra for fortran...
#
LINKLIBS += -lg2c

#
# System
#
OBJEXT = .o
LIBEXT = .a
DLLEXT = .jnilib
LIBPRE = lib
EXEEXT =
TAREXT = .tar.gz
DTMP = /tmp/$(DST)
DTAR = tar z
