# *************************************************************************
# *                                                                       *
# *  Makefile for                                                         *
# *                                                                       *
# *  ep    				  	                          *
# *                                                                       *
# *  Burgahrdt Groeber, 9/12/92
# *************************************************************************

# Choose a suitable C compiler
CC	= cc

# Choose flags for the C compiler(e.g. "-O2" for optimization)
CFLAGS	= 

# The place to install the binaries, will be created if not existing!
BIN	= $(HOME)/bin

# Directory for man pages, will be created if not existing!
MANDIR	= $(HOME)/man/manl

###########################################################################
# NO CHANGES BELOW THIS LINE

# The man page
MANPAGE = ep.l


RBINS	=  System.o General.o Memory.o DynArray.o StringMem.o Idents.o Sets.o \
	   Time.o Errors.o Positions.o 
PBINS	=  EiffelScan.o EiffelScanSource.o ParserDrv.o ParserISE.o ParserMEY.o \
	   ParserSIG.o Tree.o Merge.o
BASICS	= Idents.h Sets.h System.h Time.h Errors.h Defs.h

all: ep

ep: $(PBINS) $(RBINS)
	$(CC) $(CFLAGS) $(PBINS) $(RBINS) -o ep

install:
	sh -c "if test ! -d $(BIN); then mkdir $(BIN); else true; fi"
	cp ep $(BIN); chmod 755 $(BIN)/ep;
	sh -c "if test ! -d $(MANDIR); then mkdir $(MANDIR); else true; fi"
	cp $(MANPAGE) $(MANDIR); chmod a+r $(MANDIR)/$(MANPAGE);

test:	
	$(BIN)/ep -MEY Test/TestMEY.e

example: Examples/gett.o $(RBINS)
	$(CC) $(CFLAGS) -o Examples/gett  Examples/gett.c Tree.o $(RBINS)

clean:
	rm -f *.o ep core Test/*.atr 
	rm -f Examples/gett Examples/gett.o Examples/core

DynArray.o:     DynArray.h Memory.h ratc.h
General.o:      General.h ratc.h
Idents.o:       Idents.h StringMem.h DynArray.h ratc.h
Memory.o:       Memory.h System.h General.h ratc.h
Sets.o:         Sets.h DynArray.h General.h ratc.h
StringMem.o:    StringMem.h DynArray.h ratc.h
System.o:	System.h ratc.h
Time.o:         Time.h ratc.h
Positions.o:    Positions.h ratc.h
Errors.o:       Errors.h Positions.h ratc.h

EiffelScan.o:	$(BASICS) EiffelScan.h 
EiffelScanSource.o: $(BASICS) EiffelScanSource.h EiffelScanSource.h 
ParserDrv.o:	$(BASICS) ParserDrv.h Merge.c
ParserISE.o:	ParserISE.h EiffelScan.h Tree.h
ParserMEY.o:	ParserMEY.h EiffelScan.h Tree.h
ParserSIG.o:	ParserSIG.h EiffelScan.h Tree.h
Tree.o:		$(BASICS) Tree.h yyTree.w
