#################################################################################
#
# makefile.linux - 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.
#
# Note: Caller must set CC and LD environment variables.  For example:
#
# export CC=/export/std11_fac/bin/CC
# export LD=/usr/ccs/bin/ld 
#
# Note: Undefined Gci symbol warnings at link time are normal
#
# $Id: makefile.solaris,v 1.1 2007-09-14 22:41:16 normg Exp $
#
#################################################################################


TARGET_DIR = ./solaris
CC_FLAGS = -c  -xarch=v8plus -xildoff -xO4 -mt -D_REENTRANT -xcode=pic32
LD_FLAGS = -G -B symbolic -h $@

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

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