#
# Copyright (c) 1992 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
# Internet Rover Problem Manager
#
INCLUDES=	-I../../../include
DEFINES= -DANYORDER
CFLAGS=	 ${INCLUDES} ${DEFINES} ${ACFLAGS}
LDFLAGS= -L${LIBDIR} -lStatusFileManager -lProblemManager -lctools ${ALDFLAGS}

SRCS=	conv.c debug.c memory.c io.c g.c
OBJS=	conv.o debug.o memory.o io.o g.o
HDRS=

default:
	( cd ../../.. ; make statusfilemanager)

all:	StatusFileManager.a SortStatus

StatusFileManager.a: ${OBJS} version.c
	  	ar cru StatusFileManager.a ${OBJS}
		cp StatusFileManager.a ${LIBDIR}/libStatusFileManager.a
	  	ranlib ${LIBDIR}/libStatusFileManager.a

SortStatus: SortStatus.o g.o
	${CC} -o $@ version.c g.o SortStatus.o ${LDFLAGS}

version.c: Version.c
	(u=$${USER-root} h=`hostname` t=`date` v=`cat ../../../VERSION`; \
	sed -e "s|%WHEN%|$${t}|" \
	    -e "s|%VERSION%|$${v}|" \
	    -e "s|%WHOANDWHERE%|$${u}@$${h}|" \
	    < Version.c > version.c)

install:
	cp StatusFileManager.a ${LIBDIR}/libStatusFileManager.a
	rm -f ${BINDIR}/SortStatus
	cp SortStatus ${BINDIR}/SortStatus
	ranlib ${LIBDIR}/libStatusFileManager.a

depend: ${SRCS}
	mkdep ${CFLAGS} ${SRCS}

lint: ${SRCS}
	lint -Dlint ${INCLUDES} ${DEFINES} ${SRCS}

tags:
	ctags -t ${SRCS} ${HDRS}

clean:
	rm -f *.o core *.a 

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

conv.c:
debug.c:
memory.c:
io.c:
g.c:

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
