#
# Makefile for the gram tutorial programs
#
#
# Requires that the GLOBUS_DEVELOPMENT_PATH variables is set. This 
# environment variable must point to the Globus development directory
# containing the flavor or libraries, etc. that you wish to use when
# building this example.  This environment variable should be set in
# the shell prior to envoking make.  The utility program
# $GLOBUS_PATH/globus-development-path can be used to assist you in
# determining the correct setting. For usage information type
# $GLOBUS_PATH/globus-development-path -help 
#
# For example:
# 
# SH:
#
# Non-threaded: 
#
# GLOBUS_DEVELOPMENT_PATH = `$GLOBUS_PATH/globus-development-path -nothreads`
# export GLOBUS_DEVELOPMENT_PATH
#
# Threaded:
#
# GLOBUS_DEVELOPMENT_PATH = `$GLOBUS_PATH/globus-development-path -threads`
# export GLOBUS_DEVELOPMENT_PATH
#
# CSH:
#
# Non-threaded:
#
# setenv GLOBUS_DEVELOPMENT_PATH \
#	`$GLOBUS_PATH/globus-development-path -nothreads`
# 
# Threaded:
#
# setenv GLOBUS_DEVELOPMENT_PATH \
# 	`$GLOBUS_PATH/globus-development-path -threads`
#

include $(GLOBUS_DEVELOPMENT_PATH)/etc/makefile_header

GRAMTEST_CFLAGS   = -I$(includedir) $(CFLAGS)  \
		    $(GLOBUS_COMMON_CFLAGS) \
		    $(GLOBUS_GRAM_CLIENT_CFLAGS)
GRAMTEST_LDFLAGS  = -L$(libdir) $(LDFLAGS) \
		    $(GLOBUS_COMMON_LDFLAGS) \
		    $(GLOBUS_GRAM_CLIENT_LDFLAGS)
GRAMTEST_LIBS     = $(GLOBUS_COMMON_LIBS) \
		    $(GLOBUS_GRAM_CLIENT_LIBS) \
		    $(LIBS)

MYJOBTEST_CFLAGS  = $(GRAMTEST_CFLAGS) $(GLOBUS_GRAM_MYJOB_CFLAGS) 

MYJOBTEST_LDFLAGS = $(GRAMTEST_LDFLAGS) $(GLOBUS_GRAM_MYJOB_LDFLAGS)

MYJOBTEST_LIBS    = $(GLOBUS_GRAM_MYJOB_LIBS) \
		    $(GRAMTEST_LIBS)

EXECS = gramtest myjobtest

all: $(EXECS)

gramtest:	gramtest.o
	$(CC) $(GRAMTEST_CFLAGS) $(GRAMTEST_LDFLAGS) -o gramtest \
	gramtest.o $(GRAMTEST_LIBS)

gramtest.o:	gramtest.c
	$(CC) $(GRAMTEST_CFLAGS) -c gramtest.c

myjobtest:	myjobtest.o
	$(CC) $(MYJOBTEST_CFLAGS) $(MYJOBTEST_LDFLAGS) -o myjobtest \
	myjobtest.o $(MYJOBTEST_LIBS)

myjobtest.o:	myjobtest.c
	$(CC) $(MYJOBTEST_CFLAGS) -c myjobtest.c

clean:
	$(RM) -f $(EXECS) *.o






