# Compile with floating point flag if your machine has it!

# If your make does not define LINK.c, uncomment the following line
LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(LDFLAGS) $(LDFLAGS)

CFLAGS = -Aa -D_HPUX_SOURCE -O -I/usr/include/X11R5 -L/usr/lib/X11R5

# To have both plot support and X windows support, define:
# G3D_DEFS = -DHAVE_X
# G3D_LIBS = -lm -lX11
# G3D_OBJECTS = graph3d.o Xsupport.o direct-tek.o stdoutpipe.o
# If you do not have X windows, remove -DHAVE_X, -lX11 and Xsupport.o
G3D_DEFS = -DHAVE_X
G3D_LIBS = -lm -lX11
G3D_OBJECTS = graph3d.o Xsupport.o

TARGETS = hills graph3d surface hat pswrap

all: $(TARGETS)

pswrap: pswrap.o
	$(LINK.c) -o pswrap pswrap.o -lm

hat: hat.o
	$(LINK.c) -o hat hat.o -lm

hills: hills.o
	$(LINK.c) -o hills hills.o -lm

graph3d: $(G3D_OBJECTS)
	$(LINK.c) -o graph3d $(G3D_OBJECTS) $(G3D_LIBS)

graph3d.o: graph3d.c types.h
	$(LINK.c) $(G3D_DEFS) -c graph3d.c

Xsupport.o: types.h

surface: surface.o read_matrix.o showfloat.o
	$(LINK.c) -o surface surface.o read_matrix.o showfloat.o -lm

clean:
	rm -f $(TARGETS) *.o
