######################################################################
# Sample makefile for building gsstat.cc on AIX using the
# IBM Visual Age C++ Compiler
#
# $Id: makefile.aix,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=/usr/vacpp/bin/xlC_r
#
######################################################################

# Use this one if you want to use a debugger with your program
# CCFLAGS = -g -q64 -qarch=ppc -D_REENTRANT
# 
# Use this one for fastest performance
CCFLAGS = -q64 -qarch=ppc -O3 -qstrict -D_REENTRANT

LDFLAGS = -brtl -L$(GEMSTONE)/lib -L/usr/lib/threads -lgcsi -lpthreads -lm -lc_r -ldl

#  -Wl,-bnoquiet: this flag generates more linker messages than you'll ever want or need output
# LDFLAGS = -brtl -q64 -qarch=ppc -Wl,-bnoquiet 

TARGET_DIR = ./aix
$(TARGET_DIR)/gsstat: $(TARGET_DIR)/gsstat.o
	$(CC) $(CCFLAGS) $(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
