# -*- Makefile -*-
# simple distribution method, `make distrib; make tar.gz'
DATE="23 February 1997"#
VERSION=1.01#
VERNAME=fftn-$(VERSION)#
DIST =	INSTALL Makefile README test-all.c test-fftn.c\
	fft.f fft.f66 fftn.c fftn.h singleton.f90

#
# Makefile for testing
# set your compiler and its flags
# there are several defines that you can use for test-all.c
#
# defines for fftn.c
# -DFFT_NODOUBLE to avoid compiling double precision
# -DFFT_FLOAT to compile float precision
# -DFFT_RADIX4 if you only want radix 2, radix 4 transforms
# -DSUN_BROKEN_REALLOC if your realloc() function doesn't accept NULL
#

# gcc
# CC = gcc
# CFLAGS = -ansi -pedantic -O2 -Wall

# AIX
# CC = xlc
# CFLAGS = -O2

# ------
.SUFFIXES:
.SUFFIXES: .o .c .h

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

# ------
default: fftn.o

test-fftn:	fftn.o test-fftn.o
	$(CC) -o $@ fftn.o test-fftn.o -lm

test-all:	fftn.o test-all.o
	$(CC) -o $@ fftn.o test-all.o -lm

test-all.o:	test-all.c
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(INCLUDE) $(TEST_DEFS) $<

fftn.o:  fftn.c fftn.h

clean:
	rm -f *~ *.o

realclean: clean
	rm -f test-fftn test-all

# some targets to make distributing the files easier

distrib:
	@if test ! -d ../$(VERNAME); then mkdir ../$(VERNAME); fi
	cp -f $(DIST) ../$(VERNAME)

../$(VERNAME).tar.gz:
	(cd ..; tar cvf - $(VERNAME) | gzip -f9 > $(VERNAME).tar.gz)

tar.gz:  ../$(VERNAME).tar.gz

uuencode: tar.gz
	uuencode ../$(VERNAME).tar.gz $(VERNAME).tar.gz > ../$(VERNAME).tgz.uu

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