MAKEFILE= Makefile
ROOTDIR		= $(PIPSDIR)

CPREFIX=
TARGET=	all
PROFILING= -pg 
CC	= $(CPREFIX)cc
INCLUDE	= 
CFLAGS	= -I../../include.dir $(PROFILING) $(CLOCALFLAGS)
LFLAGS  = -I../../include.dir $(LLOCALFLAGS)
YFLAGS	= -d
FFLAGS	= -onetrip -w66 -O
LDFLAGS	= $(PROFILING)
LIBS	= 
#	Directory where program is installed
INSDIR	= $(BINDIR)
LINT	= $(CPREFIX)lint $(LLOCALFLAGS) -habx
AR	= $(CPREFIX)ar
LORDER	= $(CPREFIX)lorder
RANLIB	= $(CPREFIX)ranlib

HEADERS	= 
INCLUDES= 
CFILES	= arith-test.c arith-test-look-up.c divide-test.c divide-test-look-up.c
FFILES	= 
ASFILES	= 
YACCFILES= 
LEXFILES= 
SHFILES	= 
MANFILES= 
DOCFILES= 
OTHERS	= 
OBJECTS	= arith-test.o arith-test-look-up.o divide-test.o divide-test-look-up.o
SOURCE	= $(MAKEFILE) $(MANFILES) $(DOCFILES) $(SHFILES) $(OTHERS) 	$(HEADERS) $(INCLUDES) $(YACCFILES) $(LEXFILES) $(CFILES) 	$(FFILES) $(ASFILES)
LISTFILES= $(MAKEFILE) $(SHFILES) $(HEADERS) $(INCLUDES) \
	$(YACCFILES) $(LEXFILES) $(CFILES) $(FFILES) $(ASFILES)

all: arith-test arith-test-look-up divide-test divide-test-look-up

divide-test-look-up: divide-test-look-up.o
	$(CC) $(LDFLAGS) divide-test-look-up.o -o divide-test-look-up $(LIBS) \
	../../arithmetique.dir/arithmetique.a
	size divide-test-look-up

divide-test: divide-test.o
	$(CC) $(LDFLAGS) divide-test.o -o divide-test $(LIBS) \
	../../arithmetique.dir/arithmetique.a
	size divide-test

arith-test: arith-test.o
	$(CC) $(LDFLAGS) arith-test.o -o arith-test $(LIBS) \
	../../arithmetique.dir/arithmetique.a
	size arith-test

arith-test-look-up: arith-test-look-up.o
	$(CC) $(LDFLAGS) arith-test-look-up.o -o arith-test-look-up $(LIBS) \
	../../arithmetique.dir/arithmetique.a
	size arith-test-look-up

tar:
	tar rfcb /dev/rht0 20 $(SOURCE)
cpio:
	ls $(SOURCE) | cpio -oB
netsend:
	netsend $(dest) $(SOURCE)
lint:
	$(LINT) $(LFLAGS) -I$(INCLUDE) $(CFILES)
clean:
	-rm -f $(OBJECTS) \
		 arith-test arith-test-look-up divide-test divide-test-look-up
clobber: clean
	-rm -f $(TARGET)
touch:
	touch $(TARGET)
print:	list60
list:	list66
list66:
	@pr -n -w132 -l66 $(LISTFILES)
list60:
	@pr -n -w132 -l60 $(LISTFILES)
list51:
	@pr -n -w132 -l51 $(LISTFILES)
TAGS: $(SOURCE)
	etags -t $(SOURCE)
vgrind:
	@vgrind $(LISTFILES)

depend:
	sed -n -e '1,/^### DO NOT DELETE THIS LINE./p' < $(MAKEFILE) > $(MAKEFILE).new
	-for i in $(YACCFILES) $(LEXFILES) $(CFILES) $(FFILES) ; do\
		base=`expr $$i ':' '\(.*\).[cylf]$$'`;\
		suffix=`expr $$i ':' '.*\.\([cylf]\)$$'`;\
		if test $$suffix = l ; then\
			lex $$i;\
			mv lex.yy.c $$base.c;\
			suffix=c;\
			/bin/echo "$$base.c:	$$base.l" >> $(MAKEFILE).new;\
		elif test $$suffix = y ; then\
			yacc $(YFLAGS) $$i;\
			mv y.tab.c $$base.c;\
			suffix=c;\
			/bin/echo "$$base.c:	$$base.y" >> $(MAKEFILE).new;\
			/bin/echo "y.tab.h:	$$base.y" >> $(MAKEFILE).new;\
		fi;\
		/lib/cpp -I../../include.dir $(INCLUDEFLAGS) \
			-M $$base.$$suffix >> $(MAKEFILE).new;\
	done;
	mv $(MAKEFILE).new $(MAKEFILE)
### The following dependancies are/can be generated automatically
### by 'make depend'. Listen to this warning
###
### Do NOT put any of your own dependancies below this line,
### they will be removed
### DO NOT DELETE THIS LINE. USED FOR MAKE DEPEND
arith-test.o: arith-test.c
arith-test.o: /usr/include/stdio.h
arith-test.o: ../../include.dir/assert.h
arith-test.o: ../../include.dir/arithmetique.h
arith-test-look-up.o: arith-test-look-up.c
arith-test-look-up.o: /usr/include/stdio.h
arith-test-look-up.o: ../../include.dir/assert.h
arith-test-look-up.o: ../../include.dir/arithmetique.h
divide-test.o: divide-test.c
divide-test.o: /usr/include/stdio.h
divide-test.o: ../../include.dir/assert.h
divide-test.o: ../../include.dir/arithmetique.h
divide-test-look-up.o: divide-test-look-up.c
divide-test-look-up.o: /usr/include/stdio.h
divide-test-look-up.o: ../../include.dir/assert.h
divide-test-look-up.o: ../../include.dir/arithmetique.h
