# =============================================================================
# Makefile - additional tools makefile
# -----------------------------------------------------------------------------
# Copyright (C) 1995-1997 by Karim Kaschani
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# to rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
# =============================================================================

BINDIR	= /usr/local/bin
MANDIR	= /usr/local/man/man1

# -------------------------------------------------------------- Solaris 2.4x86

#CC	= gcc
#CFLAGS	= -c -O2
#LDFLAGS	= -lm -lc
#INSTALL	= /usr/ucb/install

# ----------------------------------------------------------------------- LINUX

CC	= gcc
CFLAGS	= -c -g
LDFLAGS	= -lm -lc
INSTALL	= /usr/bin/install

# ------------------------------------------------------------------------ HPUX

#CC	= cc
#CFLAGS	= -c -O
#LDFLAGS	= -lm -lc
#INSTALL	= /usr/local/bin/install

# ------------------------------------------------------------- general section

all: merge fft spline

merge: merge.o
	$(CC) -o $@ merge.o $(LDFLAGS)

fft: fft.o
	$(CC) -o $@ fft.o $(LDFLAGS)

spline: spline.o
	$(CC) -o $@ spline.o $(LDFLAGS)

.c.o:
	$(CC) $(CFLAGS) $*.c

clean:
	rm -f *.o merge fft spline core

install:
	$(INSTALL) -s -m 755 merge   $(BINDIR)
	$(INSTALL) -s -m 755 fft       $(BINDIR)
	$(INSTALL) -s -m 755 spline    $(BINDIR)
	$(INSTALL)    -m 644 merge.1 $(MANDIR)
	$(INSTALL)    -m 644 fft.1     $(MANDIR)
	$(INSTALL)    -m 644 spline.1  $(MANDIR)

uninstall:
	rm -f $(BINDIR)/merge
	rm -f $(BINDIR)/fft
	rm -f $(BINDIR)/spline
	rm -f $(MANDIR)/merge.1
	rm -f $(MANDIR)/fft.1
	rm -f $(MANDIR)/spline.1
