# -------------------------------------------------------------------------
# Makefile for revised version of LCSOFM. File built for Cray YMP-8/864
# at Center for High Performance Computing, University of Texas.
# -------------------------------------------------------------------------

RM=rm -f
CC=cc

#	Compiler Flags, Include, Library Paths
#	--------------------------------------
CFLAGS= -g -O2 -h task3 -h report=istvf
INCLUDES= -I/local/include
LIBS=  -lXm -lXt -lX11 -lm -L/local/lib
DEFINES = -DDEBUG1 -DXWINDOW -DCRAY -DNO_PROTO
#DEFINES = -DCRAY -DNO_PROTO

#	Rule to create .o  files from .c files
#	--------------------------------------
.c.o:
	$(RM) $@
	$(CC) -c  $(CFLAGS) $(DEFINES) $(INCLUDES) $*.c

#############################################################################
# xlcsofm is the revised, debugged version of xlatsofm17. There are 
# substantial modifications to the interface.

xlcsofm: lcsofm.o inputs.o xdraw.o xdisplay.o
	$(RM) $@
	$(CC) -o $@ $(CFLAGS) lcsofm.o inputs.o xdraw.o xdisplay.o $(LIBS)
############################################################################
lcsofm: lcsofm.o inputs.o
	$(RM) $@
	$(CC) -o $@ $(CFLAGS) lcsofm.o inputs.o $(LIBS)
############################################################################
xdisplay.o: xdisplay.c globals.h latdefs.h
	$(CC) -c  $(CFLAGS) $(DEFINES) $(INCLUDES) xdisplay.c
#############################################################################

lcsofm.o: lcsofm.c globals.h latdefs.h
	$(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) lcsofm.c
#############################################################################

inputs.o: inputs.c globals.h latdefs.h
	$(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) inputs.c

#############################################################################

xdraw.o: xdraw.c globals.h latdefs.h
	$(CC) -c  $(CFLAGS) $(DEFINES) $(INCLUDES) xdraw.c

#############################################################################
# visualize is the revised version of visualize17.c for xlcsofm.

visualize: visualize.o
	$(CC) -o $@ $(CFLAGS) visualize.o $(LIBS)

#############################################################################

visualize.o: visualize.c globals.h
	$(CC) -c  $(CFLAGS) $(DEFINES) $(INCLUDES) visualize.c