####################################################################
#   Copyright (c) 1996 NPACT Working Group. You may copy,          #
#   distribute, and modify it freely as long as you preserve this  #
#   copyright and permission notice.                               #
#                                                                  #
#   NPACT Working Group is a joint force of                        #
#      NPAC at Syracuse University,                                #
#      PACT at Harbin Institute of Technology, and                 #
#      PACT at Peking University                                   #   
####################################################################

#
#  Makefile for Basic lib 
#

SHELL       = /bin/sh

VERSION     = @VERSION@

srcdir      = @srcdir@
top_srcdir  = @top_srcdir@

config_dir  = ../include

prefix      = @prefix@

exec_prefix = ${prefix}
bindir      = ${exec_prefix}/bin

htmldir	    = $(HOME)/index

VPATH       = .:${srcdir}

INCLUDEDIR  = ${top_srcdir}/src/include

CFLAGS   = @CFLAGS@ @DEFS@ -I. -I${srcdir} -I$(config_dir) -I$(INCLUDEDIR)
CXXFLAGS = @CXXFLAGS@ @DEFS@ -I. -I${srcdir} -I$(config_dir) -I$(INCLUDEDIR)

CC  = @CC@
CXX = @CXX@

LIB=../xsageop/libxsage.a ../basicop/libbasic.a
LIBS = -lxsage -lbasic
LIBDIR = -L../xsageop -L../basicop

PROGRAM = tof77

OBJS =  tof77.o vardecl.o transfunc.o transcontrol.o transcase.o record.o serial.o

.SUFFIXES:
.SUFFIXES: .o .c .cc

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

.cc.o:
	$(CXX) -c $(CXXFLAGS) $<


all: Makefile $(PROGRAM)

Makefile: Makefile.in
	@echo 
	@echo Please configure the package to generate new makefile ...
	@exit 1

clean:
	rm -f *.o core $(PROGRAM)

$(PROGRAM): $(LIB) $(OBJS)
	$(CXX) -g -o $@ $(OBJS) $(LIBDIR) $(LIBS)

install: $(PROGRAM)
	if [ ! -d ${bindir} ] ; then mkdir ${bindir} ; fi
	cp $(PROGRAM) ${bindir}

uninstall:
	rm -f ${bindir}/$(PROGRAM)


############
# file dependence information
############


tof77.o : tof77.cc  tof77.h
vardecl.o : vardecl.cc  tof77.h
transfunc.o : transfunc.cc  tof77.h
transcontrol.o : transcontrol.cc  tof77.h
transcase.o: transcase.cc  tof77.h
record.o: record.cc  tof77.h
serial.o: serial.cc  tof77.h

html: $(htmldir)/tof77/index.html

$(htmldir)/tof77/index.html: tof77.h
	doc++ -d $(htmldir)/tof77 tof77.h
