AADIR = /u/sullivan/aarg
OPTS = -g -DDEBUG
CFLAGS = $(OPTS) -DSUN
#NGSDIR = /u/sullivan/ngs
#PLOT = plot.o $(NGSDIR)/ngs.a
LD = cc
FFLAGS = -c $(OPTS)
#LIBS = -Bstatic -L$(AADIR) -laa.i -lm
LIBS = -lm
SRCS = setup.c init.c tracer.c structs.c areas.c standard.c orth.c \
	first3.c printer.c inner_loop.c
OBJS = setup.o init.o tracer.o structs.o areas.o standard.o orth.o \
	first3.o printer.o inner_loop.o
MAINS = vtest.o vcs.o

default: vcs

clean:
	rm -f $(OBJS) $(MAINS) point.o vcs vtest

lint:
	lint -abu $(SRCS) point.c noplot.c vcs.c > linterr
#	lint -abchu $(SRCS) point.c noplot.c vcs.c > linterr

#point.o $(OBJS) $(MAINS): point.h
#plot.o point.o $(OBJS) $(MAINS): vcs.h

setup.o: queue.h

tracer.o: queue.h

fo: inner_loop.f
	$(FC) $(FFLAGS) inner_loop.f

co: inner_loop.c
	$(CC) $(CFLAGS) -c inner_loop.c

ho: inner_loop.hand
	cp inner_loop.hand inner_loop.s
	$(CC) $(CFLAGS) -c inner_loop.s

plot.o: $(NGSDIR)/ngs.h
	$(CC) $(CFLAGS) -I$(NGSDIR) -c plot.c

ptest: ptest.o standard.o point.o
	$(LD) $(LDFLAGS) -o ptest ptest.o point.o standard.o $(LIBS)

vtest: vtest.o $(OBJS) point.o
	$(LD) $(LDFLAGS) -o vtest vtest.o $(OBJS) point.o $(LIBS)

vcs:vcs.o $(OBJS) point.o
	$(LD) $(LDFLAGS) -o vcs vcs.o $(OBJS) point.o $(LIBS)
