#
#  Make file: Makefile
#
#  Program:   impcurv and parcurv (implicit and parametric curvature lines 
#	        generators for project Riemann)
#
#  Contents:  This is the make file for the impcurv and parcurv executables.
#

USERDIR= ../userinter
OUTDIR= ../output
MATHDIR= ../mathbase
INCLDIR= ../include

DEBUG= -O
INCLUDE= -I$(INCLDIR)
MOEBIUS=
CFLAGS= $(DEBUG) $(INCLUDE) $(MOEBIUS)
LIB= -lm
CC= gcc

CURVSRC=    cd.c mesh.c
CURVOBJ=    cd.o mesh.o
IMPSRC=     implicit.c $(CURVSRC)
IMPOBJ=     implicit.o $(CURVOBJ)
PARSRC=	    parametric.c $(CURVSRC)
PAROBJ=	    parametric.o $(CURVOBJ)
IMPUSERSRC= $(USERDIR)/userinter.c $(USERDIR)/ICuserinter.c
IMPUSEROBJ= $(USERDIR)/userinter.o $(USERDIR)/ICuserinter.o
PARUSERSRC= $(USERDIR)/userinter.c $(USERDIR)/PCuserinter.c
PARUSEROBJ= $(USERDIR)/userinter.o $(USERDIR)/PCuserinter.o
OUTSRC=     $(OUTDIR)/output.c
OUTOBJ=     $(OUTDIR)/output.o
MATHSRC=    $(MATHDIR)/*.c $(MATHDIR)/*.l $(MATHDIR)/*.y
MATHOBJ=    $(MATHDIR)/mathbase.a

TOTALIMPOBJ= $(IMPOBJ) $(IMPUSEROBJ) $(OUTOBJ) $(MATHOBJ)
TOTALPAROBJ= $(PAROBJ) $(PARUSEROBJ) $(OUTOBJ) $(MATHOBJ)


standard: impcurv parcurv

impcurv: $(TOTALIMPOBJ)
	$(CC) $(TOTALIMPOBJ) $(CFLAGS) -o impcurv $(LIB)

parcurv: $(TOTALPAROBJ)
	$(CC) $(TOTALPAROBJ) $(LIB) $(CFLAGS) -o parcurv

$(MATHOBJ): $(MATHSRC) $(MATHDIR)/*.h $(INCLDIR)/master.h $(INCLDIR)/parsepoly.h
	( cd $(MATHDIR); make $(MFLAGS) )

$(USERDIR)/userinter.o: $(USERDIR)/userinter.c $(INCLDIR)/master.h \
  $(INCLDIR)/userinter.h
	( cd $(USERDIR); make $(MFLAGS) )

$(USERDIR)/ICuserinter.o: $(USERDIR)/ICuserinter.c $(INCLDIR)/master.h \
  $(INCLDIR)/userinter.h
	( cd $(USERDIR); make $(MFLAGS) )

$(USERDIR)/PCuserinter.o: $(USERDIR)/PCuserinter.c $(INCLDIR)/master.h \
  $(INCLDIR)/userinter.h
	( cd $(USERDIR); make $(MFLAGS) )

$(OUTOBJ): $(OUTSRC) $(INCLDIR)/master.h
	( cd $(OUTDIR); make $(MFLAGS) )

lint: implint parlint

implint: $(IMPSRC)
	lint $(INCLUDE) $(IMPSRC) > implint

parlint: $(PARSRC)
	lint $(INCLUDE) $(PARSRC) > parlint

install: impcurv parcurv
	cp impcurv parcurv ../../bin

tags: *.c
	ctags *.c

clean:
	rm -f impcurv parcurv $(IMPOBJ) $(PAROBJ) core implint parlint tags

maketd:
	maketd $(INCLUDE) $(IMPSRC) $(PARSRC)

# DO NOT DELETE THIS LINE - maketd DEPENDS ON IT
# Dependencies generated at: Tue Aug  1 20:24:07 EST 1989

cd.o: ../include/curvature.h
cd.o: ../include/master.h
cd.o: cd.c
implicit.o: ../include/curvature.h
implicit.o: ../include/implicit.h
implicit.o: ../include/master.h
implicit.o: implicit.c
mesh.o: ../include/curvature.h
mesh.o: ../include/master.h
mesh.o: ../include/parametric.h
mesh.o: mesh.c
parametric.o: ../include/curvature.h
parametric.o: ../include/master.h
parametric.o: ../include/parametric.h
parametric.o: parametric.c

# DO NOT ADD ANYTHING HERE - WILL GO AWAY

