# makefile.joinu_wjs  2 Oct 97.  WJS
#  changed name to makefile.join for optionserver use 25 Feb 98 CLH
#
# moved to optsrc/join November 4, 1998 clh, with associated changes
#   required to allow make to find everything - aim was to make consistent
#   with the other OO methods and programs
#
# Assumes jgofs 1.5 distribution and that this file,
#    along with the sources, is in optsrc/* under the jgofs root.
#
# Can be run standalone if:
#	1) jgofs_root/opt-build-env has been executed first in context of
#	   this process (ie, cd jgofs_root; source opt-build-env)
#	2) jgofs.a library has already been built
#
TOPLEVEL = ../../
METHBINDIR  = ${TOPLEVEL}methods
INCDIR = ../include
OUTERSRCDIR = ../methods
SRCDIR = .
LIBDIR  = ../lib

METHOD = ${METHBINDIR}/optjoin

#	Files which need to be compiled in order to build join
OBJ =   ${OUTERSRCDIR}/outer.c \
	${SRCDIR}/join.c

#	.h files (or other included files) on which inner or outer depend
INCLUDED_FILES = ${INCDIR}/default.h \
		 ${INCDIR}/inner.h \
		 ${INCDIR}/outer.h

#	libraries required
LIB_LIST = ${LIBDIR}/jgofs.a

#	Method-specific compilation flags
METHOD_CFLAGS = 

#	Compilation switches
SWITCHES = -DOPTIONS='"${INCDIR}/default.h"' \
           -DINNEROPTIONS='"${INCDIR}/inner.h"' \
	   -DMYADDR='"${MYADDR}"' \
	   -DOPTIONSERVER='"${OPTIONSERVER}"' \
	   -DINFOSERVER='"${INFOSERVER}"' \
	   -DDIRSERVER='"${DIRSERVER}"' \
	   -DQUOTENOLINK

#######################

all: ${METHOD}

${METHOD}:${OBJ} ${INCLUDED_FILES} ${LIB_LIST}
	@-test -d ${METHBINDIR} || mkdir ${METHBINDIR}
#		-I. used so that outer can find included files in
#		source directory if needed
		$(CC) \
			${CFLAGS} ${METHOD_CFLAGS} \
			${SWITCHES} \
			-DBUTTONIMAGESDIR='"${BUTTONIMAGESDIR}"' \
			-I${SRCDIR} \
			-I${INCDIR} \
			${OBJ} \
			${LIB_LIST} \
		-o $@ 

clean:
	-rm ${SRCDIR}/join.o \
	    ${SRCDIR}/outer.o \
	    ${METHOD}
