######################################################################
# Sample makefile for building gsstat.cc on Solaris using the 
# Sun Workshop C++ compiler
#
# $Id: makefile.solaris,v 1.1 2007-07-19 04:00:06 normg Exp $
#
# Make sure $GEMSTONE is set correctly.
#
# Make sure $GEMSTONE/lib is in LD_LIBRARY_PATH
#   example: export LD_LIBRARY_PATH=$GEMSTONE/lib:$LD_LIBRARY_PATH
#
# Make sure the environment variable CC references your C++ compiler
#   example: export CC=/export/std11_fac/bin/CC
#
######################################################################

# Use this one if you want to use a debugger with your program
#CCFLAGS = -xildoff -g -mt -xarch=v9 -D_REENTRANT

# Use this one for fastest performance
CCFLAGS = -xildoff -xO4 -mt -xarch=v9 -D_REENTRANT

LDFLAGS = -L$(GEMSTONE)/lib -B dynamic -lgcsi -lc -lpthread -ldl -lm -lnsl -lCrun
TARGET_DIR = ./solaris
$(TARGET_DIR)/gsstat: $(TARGET_DIR)/gsstat.o
	$(CC) $(CCFLAGS) -i $(TARGET_DIR)/gsstat.o -o $(TARGET_DIR)/gsstat $(LDFLAGS)

$(TARGET_DIR)/gsstat.o: gsstat.cc
	mkdir -p $(TARGET_DIR) >/dev/null 2>&1
	$(CC) -c $(CCFLAGS) gsstat.cc -o $(TARGET_DIR)/gsstat.o -I$(GEMSTONE)/include
