# $Id: Makefile.mk,v 1.5 1996/08/02 16:33:28 deaven Exp $
#  machine-independent makefile for xyplot
#  Copyright (C) 1994 David Deaven
# 
#  This file is part of xyplot.
# 
#  xyplot is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
# 
#  xyplot is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
# 
#  You should have received a copy of the GNU General Public License
#  along with xyplot; see the file COPYING.  If not, write to
#  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#

# $Id: machine.mk,v 1.29 1996/08/08 19:47:25 deaven Exp deaven $
# cpp macros to make standardized makefiles for different systems
# Copyright (c)1995 David Deaven

# Dave Deaven's library (libdmd) is DMDDIR (from dmdpp)
DMDDIR = /usr/home/deaven



# #################################################################
# NetBSD open POSIX (BSD-4.4 derived)
# -----------------------------------------------------------------


ARCH_OPTIMIZE_FLAGS = -m486

CC			= gcc
C_ALWAYS_FLAGS		= -Wall -Wconversion -Wmissing-prototypes -g
C_DEBUG_FLAGS		= 
C_OPTIMIZE_FLAGS	= -O2 $(ARCH_OPTIMIZE_FLAGS)

F77			= f77
F_ALWAYS_FLAGS		=
F_DEBUG_FLAGS		= -g
F_OPTIMIZE_FLAGS	= -O2 $(ARCH_OPTIMIZE_FLAGS)

CXX			= g++
CXX_ALWAYS_FLAGS	= -fhandle-exceptions -Wall -Wconversion -Wmissing-prototypes -g
CXX_DEBUG_FLAGS		=
CXX_OPTIMIZE_FLAGS	= -O2 $(ARCH_OPTIMIZE_FLAGS)

JAVAC			= guavac
JAVA_OPTIMIZE_FLAGS	=

LD_ALWAYS_FLAGS		= -L$(DMDDIR)/lib
LD_FORTRAN_FLAGS	= -lf2c
LD_MATH_FLAGS		= -lblas -lm

.SUFFIXES: .java .class
.java.class:
	$(JAVAC) $(JAVAFLAGS) $<









# ---------------------
# This is only for my development machine --dmd

HTMLMANDIR = $(DMDDIR)/src/WWW/Software/man



# ---------------------











# ------ End of machine.mk ----------------------------------------

# This must be a directory that TeX can read
TEXINPDIR = $(HOME)/wp

MANDIR = $(DMDDIR)/man
BINDIR = $(DMDDIR)/bin
LIBDIR = $(DMDDIR)/lib

CFLAGS = $(C_ALWAYS_FLAGS) $(C_OPTIMIZE_FLAGS) -DXYPLOT_SOURCE \
  -I$(DMDDIR)/include
EXELIBS = $(LD_ALWAYS_FLAGS) -ldmd $(LD_MATH_FLAGS)

LIBOBJ = readstream.o scanrange.o scan.o format.o readspline.o

OBJ = xyplot.o misc.o ticker.o dump.o

EXE = xyplot dvips2xy libxyplot.a

default: $(EXE)

libxyplot.a: $(LIBOBJ)
	rm -f $@ ; ar qc $@ `lorder $(LIBOBJ) | tsort` ; ranlib $@ 

xyplot: $(OBJ) libxyplot.a
	$(CC) -o $@ $(OBJ) libxyplot.a $(EXELIBS)

dvips2xy: dvips2xy.o
	$(CC) -o $@ dvips2xy.o

install: libinstall xyplot dvips2xy
	install -c xyplot dvips2xy $(BINDIR)
	install -c dvips2xy.tex $(TEXINPDIR)
	install -c xyplot.ps $(LIBDIR)
	nroff -man xyplot.1 | gzip > $(DMDDIR)/man/cat1/xyplot.0.gz
	gunzip < $(DMDDIR)/man/cat1/xyplot.0.gz | col -b | 	dmdman2html -title 'xyplot manual page' > 	$(HTMLMANDIR)/xyplot.1.html
	nroff -man dvips2xy.1 | gzip > $(DMDDIR)/man/cat1/dvips2xy.0.gz
	gunzip < $(DMDDIR)/man/cat1/dvips2xy.0.gz | col -b | 	dmdman2html -title 'dvips2xy manual page' > 	$(HTMLMANDIR)/dvips2xy.1.html

libinstall: libxyplot.a
	install -c libxyplot.a $(LIBDIR)
	install -c xyplot.h $(DMDDIR)/include/dmd

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

depend:
	gcc -MM $(CFLAGS) *.c > depend.make

.include "depend.make"
