#**********************************************************************
# Standard AVS definitions from /usr/avs/examples/Makefile.

INC_FILE=$(ROOT)/usr/avs/include/Makeinclude
include $(INC_FILE)

AVS_LIBS = $(ROOT)/usr/avs/lib
BASELIBS=-lgeom -lutil -lm 
FLOWLIBS=-L$(AVS_LIBS) -lflow_c $(BASELIBS) $(LASTLIBS)
CSIMLIBS=-L$(AVS_LIBS) -lsim_c $(BASELIBS) $(LASTLIBS)
MODLIBS=-L$(AVS_LIBS) -lmdata -lmfilt -lmmapp -lmrend -lrf
F77_FLOWLIBS=-L$(AVS_LIBS) -lflow_f $(BASELIBS) $(LASTFLIBS)
F77_SIMLIBS=-L$(AVS_LIBS) -lsim_f $(BASELIBS) $(LASTFLIBS)
F77_BIND = $(ROOT)/usr/avs/bin/f77_binding
AVS_INC = -I. -I$(ROOT)/usr/avs/include
F77_INC = $(ROOT)/usr/avs/include
AVS_EXE = $(ROOT)/usr/avs/bin/avs

#**********************************************************************
# Define AVS version.

AVS_VERSION=4

#**********************************************************************
# Compilation flags.

CFLAGS=$(ACFLAGS) $(AVS_INC) -DAVS_VERSION=$(AVS_VERSION)

F77FLAGS=$(AFFLAGS)
FFLAGS=$(F77FLAGS)

G=

#**********************************************************************
# SOURCE and OBJECT files

SOURCE = hex.c ucd_planes.c ucd_line.c mat.c cut_ucd.h mat.h scale_info.h

OBJECTS = hex ucd_planes.o mat.o ucd_line.o hex.h

#**********************************************************************
# Modules and support files

all: ucd_planes ucd_line

hex: hex.c
	$(CC) $(CFLAGS) -o hex hex.c

hex.h: hex
	hex > hex.h

ucd_planes.o: ucd_planes.c hex.h

ucd_planes: ucd_planes.o mat.o hex.h
	$(CC) $(CFLAGS) -o ucd_planes ucd_planes.o mat.o $(FLOWLIBS)

ucd_line.o: ucd_line.c hex.h

ucd_line: ucd_line.o mat.o hex.h
	$(CC) $(CFLAGS) -o ucd_line ucd_line.o mat.o $(FLOWLIBS)

clean:
	- rm $(OBJECTS)
	- strip ucd_planes ucd_line

lint:
	lint $(AVS_INC) ucd_planes.c ucd_lines.c hex.c

Versions: $(SOURCE)
	fgrep '@(#)' $(SOURCE) > Versions

ucd_probes.tar: Versions
	tar cohf ucd_probes.tar Make.* Versions $(SOURCE)
