#ifndef _BLURB_
#define _BLURB_
#
#
#    DFStrace: an Experimental File Reference Tracing Package
#
#       Copyright (c) 1990-1995 Carnegie Mellon University
#                      All Rights Reserved.
#
#Permission  to use, copy, modify and distribute this software and
#its documentation is hereby granted (including for commercial  or
#for-profit use), provided that both the copyright notice and this
#permission  notice  appear  in  all  copies  of   the   software,
#derivative  works or modified versions, and any portions thereof,
#and that both notices appear  in  supporting  documentation,  and
#that  credit  is  given  to  Carnegie  Mellon  University  in all
#publications reporting on direct or indirect use of this code  or
#its derivatives.
#
#DFSTRACE IS AN EXPERIMENTAL SOFTWARE PACKAGE AND IS KNOWN TO HAVE
#BUGS, SOME OF WHICH MAY  HAVE  SERIOUS  CONSEQUENCES.    CARNEGIE
#MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.
#CARNEGIE MELLON DISCLAIMS ANY  LIABILITY  OF  ANY  KIND  FOR  ANY
#DAMAGES  WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE
#OF THIS SOFTWARE OR OF ANY DERIVATIVE WORK.
#
#Carnegie Mellon encourages (but does not require) users  of  this
#software to return any improvements or extensions that they make,
#and to grant Carnegie Mellon the  rights  to  redistribute  these
#changes  without  encumbrance.   Such improvements and extensions
#should be returned to Software.Distribution@cs.cmu.edu.
#
#static char *rcsid = "$Header: Makefile.dist,v 1.1 95/07/17 21:06:16 lily Exp $";
#endif _BLURB_

# fill in the pathname of the trace root directory below
TRACEDIR = <<fill in pathname here>>
INCLDIR = $(TRACEDIR)/include
LIBDIR = $(TRACEDIR)/lib
CFLAGS = -g

HEADERS = tracelib.h trace.h filter.h ftable.h split.h unpack.h pid.h v1.h v2.h v1_private.h v2_private.h v3_private.h
EXPORTED_HEADERS = tracelib.h

OBJECTS = trace.o filter.o ftable.o pid.o rec.o unpack.o split.o v1.o v2.o v3.o ucb.o ur.o
CSOBJECTS = atot.o parsedate.o nxtarg.o fold.o skipto.o

all: libtrace.a

libtrace.a: $(OBJECTS) $(CSOBJECTS)
	ar rv libtrace.a $(OBJECTS) $(CSOBJECTS)
	ranlib libtrace.a

filter.o: filter.c tracelib.h
	$(CC) $(CFLAGS) -c filter.c

ftable.o: ftable.c tracelib.h
	$(CC) $(CFLAGS) -c ftable.c

pid.o: pid.c pid.h tracelib.h
	$(CC) $(CFLAGS) -c pid.c

rec.o: rec.c tracelib.h
	$(CC) $(CFLAGS) -c rec.c

split.o: split.c split.h tracelib.h
	$(CC) $(CFLAGS) -c split.c

trace.o: trace.c trace.h tracelib.h filter.h split.h unpack.h
	$(CC) $(CFLAGS) -c trace.c

unpack.o: unpack.c tracelib.h unpack_private.h v1.h v2.h
	$(CC) $(CFLAGS) -c unpack.c

v1.o: v1.c tracelib.h trace.h unpack_private.h v1_private.h
	$(CC) $(CFLAGS) -c v1.c

v2.o: v2.c tracelib.h trace.h unpack_private.h v2_private.h
	$(CC) $(CFLAGS) -c v2.c

v3.o: v3.c tracelib.h trace.h unpack_private.h v3_private.h
	$(CC) $(CFLAGS) -c v3.c

ucb.o: ucb.c tracelib.h unpack_private.h ucb_private.h
	$(CC) $(CFLAGS) -c ucb.c

ur.o: ur.c tracelib.h unpack_private.h ur_private.h
	$(CC) $(CFLAGS) -c ur.c

# stuff to make atot
parsedate.c: parsedate.y parsedate.scr
	${YACC} ${_YFLAGS_} $*.y
	ed - y.tab.c < parsedate.scr
	mv y.tab.c $*.c

install: installa installh

installa: libtrace.a 
	-cp -p libtrace.a $(LIBDIR)/libtrace.a

installh: ${EXPORTED_HEADERS}
	-cp -p $> ${INCLDIR}

clean:  
	rm -f *.o *.a *~ parsedate.c

