#################################################################################
#
# makefile.hpux - 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.
#                
# We use HP aCC compiler for compiling and linking.
# Other compilers may also work if you adjust the compiler flags accordingly.
#
# Note: Caller must set CC and LD environment variables.  For example:
#
# export CC=/opt/aCC/bin/aCC
# export LD=/opt/aCC/bin/aCC
#
# $Id: makefile.hpux,v 1.1 2007-09-14 22:41:16 normg Exp $
#
#################################################################################

CC_FLAGS = -c -Ae +DD32 +O2 +Onolimit -mt +z +W212 +W749 +W740 +W863
LD_FLAGS = -b -v -z +e errno +e stdin +e stdout +e __iob +e GciUserActionLibraryMain

TARGET_DIR = ./hpux
$(TARGET_DIR)/libofflinegc6x.sl: $(TARGET_DIR)/offlinegc6x.o
	$(LD) $(LD_FLAGS) -o$@ $(TARGET_DIR)/offlinegc6x.o $(GEMSTONE)/lib/gciualib.o -ldld -lm -lc

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