# makefile.path_info    Aug 97   WJS
#	Builds make_path_info_string, parse_path_info, and test_path_info
#	executables.  all option builds the first 2; test_path_info is
#	for testing the path_info_routines package.

#  NOTE: path_info_routines is part of defgb, so it may already be
#	on the system.  Locations, versions, etc, should be checked

#   1 Jun 99.  clh. Modify for OO directory structure.
#  20 Apr 99.  Add INCDIR & SRCDIR.  WJS
#  15 May 98.  Remove comments that don't start in col 1. They caused
#	trouble on IRIX systems. (Watch out for trailing whitespace after
#	macro defn, too - don't have any if you can avoid it)
#   7 May 98.  Bug fix - no space between -I and its directory.  WJS

#  BINDIR is where executables should end up
#  INCDIR is where path_info_routines.h & error_exit_defn.h live
#  LIBDIR is where path_info_routines.c & .o live
#  SRCDIR is where main programs' .c & .o files live
#BINDIR = .
#INCDIR = .
#LIBDIR = .
#SRCDIR = .
#CC = cc
#CFLAGS = -DSOL -DSVR4 -g

TOPLEVEL =  ../../
# place executables in jgofsdir/bin
BINDIR = ${TOPLEVEL}bin/
LIBDIR = ../lib/
INCDIR = ../include/
SRCDIR = ./
#
WJS-EXECS = ${BINDIR}make_path_info_string \
            ${BINDIR}parse_path_info
#
all:	${WJS-EXECS}

${BINDIR}make_path_info_string: ${SRCDIR}make_path_info_string.o \
				 ${LIBDIR}path_info_routines.o
	$(CC) ${CFLAGS} \
		${SRCDIR}make_path_info_string.o \
		${LIBDIR}path_info_routines.o \
		-o $@

${BINDIR}parse_path_info: ${SRCDIR}parse_path_info.o \
			   ${LIBDIR}path_info_routines.o
	$(CC) ${CFLAGS} \
		${SRCDIR}parse_path_info.o \
		${LIBDIR}path_info_routines.o \
		-o $@

${BINDIR}test_path_info: ${SRCDIR}test_path_info.o \
			  ${SRCDIR}test_path_info_stdlib.o \
			  ${LIBDIR}path_info_routines.o
	$(CC) ${CFLAGS} \
		${SRCDIR}test_path_info.o \
		${SRCDIR}test_path_info_stdlib.o \
 		${LIBDIR}path_info_routines.o \
		-o $@

${SRCDIR}make_path_info_string.o: ${SRCDIR}make_path_info_string.c \
				   ${INCDIR}path_info_routines.h
	$(CC) ${CFLAGS} \
		-I${INCDIR} \
		-c ${SRCDIR}make_path_info_string.c \
		-o $@

${SRCDIR}parse_path_info.o: ${SRCDIR}parse_path_info.c \
			     ${INCDIR}path_info_routines.h
	$(CC) ${CFLAGS} \
		-I${INCDIR} \
		-c ${SRCDIR}parse_path_info.c \
		-o $@

${SRCDIR}test_path_info.o: ${SRCDIR}test_path_info.c
	$(CC) ${CFLAGS} \
		-c ${SRCDIR}test_path_info.c \
		-o $@

${SRCDIR}test_path_info_stdlib.o: ${SRCDIR}test_path_info_stdlib.c
	$(CC) ${CFLAGS} \
		-c ${SRCDIR}test_path_info_stdlib.c \
		-o $@

${LIBDIR}path_info_routines.o: ${LIBDIR}path_info_routines.c \
			        ${INCDIR}path_info_routines.h
	$(CC) ${CFLAGS} \
		-I${INCDIR} \
		-c ${LIBDIR}path_info_routines.c \
		-o $@
#
clean:
	-rm ${SRCDIR}parse_path_info.o \
            ${SRCDIR}make_path_info_string.o \
	    ${WJS-EXECS}
