# $Id: Makefile.mk,v 1.7 1996/08/02 16:25:34 deaven Exp $

# $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 ----------------------------------------

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

EXE = geocat geodiff geoinfo geolattice georand geoxyz geoextract geosphere \
	geomopac geodat georotate geosed geordf geoifn

default: $(EXE)

install: exeinstall maninstall

exeinstall: $(EXE)
	install -c $(EXE) $(DMDDIR)/bin

geocat: geocat.o 
	$(CC) -o $@ geocat.o $(EXELIBS)

geodiff: geodiff.o 
	$(CC) -o $@ geodiff.o $(EXELIBS)

geoinfo: geoinfo.o 
	$(CC) -o $@ geoinfo.o $(EXELIBS)

geolattice: geolattice.o 
	$(CC) -o $@ geolattice.o $(EXELIBS)

georand: georand.o 
	$(CC) -o $@ georand.o $(EXELIBS)

geoxyz: geoxyz.o 
	$(CC) -o $@ geoxyz.o $(EXELIBS)

geoextract: geoextract.o 
	$(CC) -o $@ geoextract.o $(EXELIBS)

geosphere: geosphere.o 
	$(CC) -o $@ geosphere.o $(EXELIBS)

geomopac: geomopac.o 
	$(CC) -o $@ geomopac.o $(EXELIBS)

geodat: geodat.o 
	$(CC) -o $@ geodat.o $(EXELIBS)

georotate: georotate.o 
	$(CC) -o $@ georotate.o $(EXELIBS)

geosed: geosed.o 
	$(CC) -o $@ geosed.o $(EXELIBS)

geordf: geordf.o 
	$(CC) -o $@ geordf.o $(EXELIBS)

geoifn: geoifn.o 
	$(CC) -o $@ geoifn.o $(EXELIBS)

maninstall:
	nroff -man geocat.1 | gzip > $(DMDDIR)/man/cat1/geocat.0.gz
	gunzip < $(DMDDIR)/man/cat1/geocat.0.gz | col -b | 	dmdman2html -title 'geocat manual page' > 	$(HTMLMANDIR)/geocat.1.html
	nroff -man geodiff.1 | gzip > $(DMDDIR)/man/cat1/geodiff.0.gz
	gunzip < $(DMDDIR)/man/cat1/geodiff.0.gz | col -b | 	dmdman2html -title 'geodiff manual page' > 	$(HTMLMANDIR)/geodiff.1.html
	nroff -man geoinfo.1 | gzip > $(DMDDIR)/man/cat1/geoinfo.0.gz
	gunzip < $(DMDDIR)/man/cat1/geoinfo.0.gz | col -b | 	dmdman2html -title 'geoinfo manual page' > 	$(HTMLMANDIR)/geoinfo.1.html
	nroff -man georand.1 | gzip > $(DMDDIR)/man/cat1/georand.0.gz
	gunzip < $(DMDDIR)/man/cat1/georand.0.gz | col -b | 	dmdman2html -title 'georand manual page' > 	$(HTMLMANDIR)/georand.1.html
	nroff -man georotate.1 | gzip > $(DMDDIR)/man/cat1/georotate.0.gz
	gunzip < $(DMDDIR)/man/cat1/georotate.0.gz | col -b | 	dmdman2html -title 'georotate manual page' > 	$(HTMLMANDIR)/georotate.1.html
	nroff -man geordf.1 | gzip > $(DMDDIR)/man/cat1/geordf.0.gz
	gunzip < $(DMDDIR)/man/cat1/geordf.0.gz | col -b | 	dmdman2html -title 'geordf manual page' > 	$(HTMLMANDIR)/geordf.1.html
	nroff -man geosed.1 | gzip > $(DMDDIR)/man/cat1/geosed.0.gz
	gunzip < $(DMDDIR)/man/cat1/geosed.0.gz | col -b | 	dmdman2html -title 'geosed manual page' > 	$(HTMLMANDIR)/geosed.1.html
	nroff -man geoxyz.1 | gzip > $(DMDDIR)/man/cat1/geoxyz.0.gz
	gunzip < $(DMDDIR)/man/cat1/geoxyz.0.gz | col -b | 	dmdman2html -title 'geoxyz manual page' > 	$(HTMLMANDIR)/geoxyz.1.html
	nroff -man geotools.1 | gzip > $(DMDDIR)/man/cat1/geotools.0.gz
	gunzip < $(DMDDIR)/man/cat1/geotools.0.gz | col -b | 	dmdman2html -title 'geotools manual page' > 	$(HTMLMANDIR)/geotools.1.html

Makefiles:

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

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

.include "depend.make"
