# ***************************************************************
#  source build-env before make-ing this file
#  Note: build routine does this for you
# ***************************************************************
#
# 20 May 09.  WJS
#	Add iovaldouble_stub per libupd 1.3 mods
#   5 Dec 06.  WJS
#	Change location of outer.h
#	Note: this file should be changed to use a per-def outer source
#     similar to the way other methods are built.  Since def is the only method
#     in src/methods that does NOT do it this way, outer.o is uniquely used by
#     def, and the problems that led to per-method outers shouldn't apply
#   1 Sep 04.  WJS
#	Remove nm, which now has its own make file
#	Add err_stub_methods to def per mods to dct, etc.  See
#     err_stub_methods.c for comments.  Remove improper dependency
#     on outer_utils.c.  Note that def still does not use the
#     "proper" way to build stuff w/outer - see other method make 
#     files if interested

TOPLEVEL =  ../../
LIBDIR = ../lib/
INCDIR = ../include/
METHBINDIR  = ${TOPLEVEL}methods/
SRCDIR = ./
OUTERSRCDIR=../methods/
OUTERINCDIR=${OUTERSRCDIR}
SWITCHES =	-DMYADDR='"${MYADDR}"' \
		-DOPTIONSERVER='"${OPTIONSERVER}"' \
		-DINFOSERVER='"${INFOSERVER}"' \
		-DDIRSERVER='"${DIRSERVER}"' \
		-DBUTTONIMAGESDIR='"${BUTTONIMAGESDIR}"'

ALL = ${METHBINDIR}def	\
      ${SRCDIR}c2f.o
#      ${METHBINDIR}nm

all: ${ALL}
#
${METHBINDIR}def:${SRCDIR}def.c \
			${OUTERINCDIR}outer.h \
			${LIBDIR}err_stub_methods.o \
			${LIBDIR}iovaldouble_stub.o \
			${OUTERSRCDIR}outer.c \
			${INCDIR}default.h \
			${INCDIR}inner.h \
			${LIBDIR}jgofs.a
	@-test -d ${METHBINDIR} || mkdir ${METHBINDIR}
	$(CC) ${CFLAGS} \
		${SWITCHES} \
		-DOPTIONS='"${INCDIR}default.h"' \
		-DINNEROPTIONS='"${INCDIR}inner.h"' \
		-I${OUTERINCDIR} -I${INCDIR}\
	        ${OUTERSRCDIR}outer.c \
		${SRCDIR}def.c \
		${LIBDIR}err_stub_methods.o \
		${LIBDIR}iovaldouble_stub.o \
		${LIBDIR}jgofs.a -o $@

#
#${METHBINDIR}nm:${SRCDIR}nm.c \
#			${INCDIR}outer.h \
#			${LIBDIR}outer_utils.c \
#			${SRCDIR}outer.c \
#			${INCDIR}default.h \
#			${INCDIR}inner.h  \
#			${LIBDIR}jgofs.a
#	$(CC) ${CFLAGS} \
#		${SWITCHES} \
#		-DOPTIONS='"${INCDIR}default.h"' \
#		-DINNEROPTIONS='"${INCDIR}inner.h"' \
#		-I${INCDIR} \
#	        ${SRCDIR}outer.c \
#		${SRCDIR}nm.c \
#		${LIBDIR}jgofs.a -o $@
#
${SRCDIR}c2f.o:${SRCDIR}c2f.c
	${CC} -c ${SRCDIR}c2f.c
#
clean:
	-rm ${SRCDIR}def.o \
#	${SRCDIR}nm.o \
	${SRCDIR}outer.o \
	${ALL}
