#################################################################################
#
# makefile.aix - Makefile for compiling and linking the offline GC GemStone
#                6.x user action library.
#
# $GEMSTONE must be set to reference a 6.x GEMSTONE directory tree, 
# **not** a GemStone64 tree.
#                
#
# $Id: makefile.aix,v 1.1 2007-09-14 22:41:16 normg Exp $
#
# We use g++ for compiling.  Other compilers will probably also work if you adjust
# the compiler flags accordingly.
#
# We strongly recommended using the IBM C compiler xlc_r for linking
# It may also be used for compiling if the compiler flags below are adjusted.
#
# Note: Caller must set CC and LD environment variables.  For example:
#
# export CC=/usr/local/bin/g++
# export LD=/usr/vac/bin/xlc_r
#
# $Id: makefile.aix,v 1.1 2007-09-14 22:41:16 normg Exp $
#
#################################################################################

TARGET_DIR = ./aix

CC_FLAGS = -O2 -fno-strict-aliasing -c -pthread -D_REENTRANT
LD_FLAGS = -Wl,-G,-bexpall

$(TARGET_DIR)/offlinegc6x.so: $(TARGET_DIR)/offlinegc6x.o
	$(LD) $(LD_FLAGS) -o $(TARGET_DIR)/libofflinegc6x.so $(TARGET_DIR)/offlinegc6x.o $(GEMSTONE)/lib/gciualib.o -lm -lc

$(TARGET_DIR)/offlinegc6x.o: offlinegc6x.cc
	mkdir -p $(TARGET_DIR)
	$(CC) $(CC_FLAGS) -o $(TARGET_DIR)/offlinegc6x.o -I$(GEMSTONE)/include offlinegc6x.cc
