# ***************************************************************
#     Remember to source opt-build-env first, if you are building 
#  any sub-set of these files outside of toplevel opt-build procedure 
# ***************************************************************
# makefile for JGOFS commands,etc. used from bin/

# 10 Jan 08.  WJS
#	Remove references to DATASYS-EXECS rather than just
# commenting them out.  Side effect is to get rid of something that
# SHOULD have been commented out but wasn't (per DWS)
#   4 Mar 05.  WJS
#	Put comments in reverse-time order
#	listvar has its own make file, so remove from here
#	trigram stuff has its own make file, so remove from here
#    (said make file also makes test programs, etc, which might be
#    the reason its make was here.  Nevertheless...)
# mod February 23, 2004 rcg
#	remove list from this make file and have list use its own.
# mod Dec.8,1999 clh
#       re-write fixurl in perl because the C version of fixurl
#	was core-dumping; faster than debugging the C code.
# added make for strpbrk.tmp, clh, Nov 8, 1999
# added default.h to list make; corrected its dependencies, clh, Sep 8, 1999
# updated for v1.5 JGOFS software clh, November 3, 1998
#
#
TOPLEVEL =  ../../
# place executables in jgofsdir/bin
BINDIR = ${TOPLEVEL}bin/
LIBDIR = ../lib/
INCDIR = ../include/
SRCDIR = ./
#

MANIPULATORS =  ${BINDIR}fixurl	\
		${BINDIR}geturl  \
		${BINDIR}htmlesc \
		${BINDIR}htmlunesc \
		${BINDIR}nawkscr \
		${BINDIR}poststring \
		${BINDIR}strpbrk

all:   ${MANIPULATORS}

#
# manipulating executables - inserting or patching up i/o
#
${BINDIR}fixurl: ${SRCDIR}fixurl.tmp
	sed "s*perllocation*${PERL}*g" < ${SRCDIR}fixurl.tmp >$@
	-chmod +x $@

${BINDIR}htmlesc:${SRCDIR}htmlesc.o ${SRCDIR}htmlescape.c
	$(CC) htmlesc.o -o $@
${SRCDIR}htmlesc.o: ${SRCDIR}htmlesc.c

${BINDIR}htmlunesc:${SRCDIR}htmlunesc.o ${SRCDIR}htmlunescape.c
	$(CC) ${SRCDIR}htmlunesc.o -o $@
${SRCDIR}htmlunesc.o: ${SRCDIR}htmlunesc.c

${BINDIR}geturl:${SRCDIR}geturl.tmp
	sed "s*perllocation*${PERL}*g" < ${SRCDIR}geturl.tmp >$@
	-chmod +x $@

${BINDIR}nawkscr:${SRCDIR}nawkscr
	-cp ${SRCDIR}nawkscr ${BINDIR}nawkscr
	-chmod +x $@

${BINDIR}poststring:${SRCDIR}poststring.o
	$(CC) ${SRCDIR}poststring.o -o $@
${SRCDIR}poststring.o: ${SRCDIR}poststring.c


${BINDIR}strpbrk: ${SRCDIR}strpbrk.tmp
	sed "s*perllocation*${PERL}*g" < ${SRCDIR}strpbrk.tmp >$@
	-chmod +x $@
#
clean:
	-rm ${SRCDIR}poststring.o  \
 	${SRCDIR}htmlesc.o ${SRCDIR}htmlunesc.o \
	${MANIPULATORS}