# Don't edit Makefile! Use conf-* for configuration.

SHELL=/bin/sh

default: it

accuconv: \
load accuconv.o djbfft.a
	./load accuconv djbfft.a 

accuconv.o: \
compile accuconv.c fftc4.h complex4.h real4.h scalec4.h complex4.h \
multiplyc4.h multiplyr4.h fftc8.h complex8.h real8.h scalec8.h \
complex8.h multiplyc8.h multiplyr8.h
	./compile accuconv.c

accuracy: \
load accuracy.o djbfft.a math.lib
	./load accuracy djbfft.a  `cat math.lib`

accuracy.o: \
compile accuracy.c fftc4.h complex4.h real4.h fftc8.h complex8.h \
real8.h fftorder.h
	./compile accuracy.c

auto-ccld.sh: \
conf-cc conf-ld warn-auto.sh
	( cat warn-auto.sh; \
	echo CC=\'`head -1 conf-cc`\'; \
	echo LD=\'`head -1 conf-ld`\' \
	) > auto-ccld.sh

auto-str: \
load auto-str.o substdio.a error.a str.a
	./load auto-str substdio.a error.a str.a 

auto-str.o: \
compile auto-str.c substdio.h readwrite.h exit.h
	./compile auto-str.c

auto_home.c: \
auto-str conf-home
	./auto-str auto_home `head -1 conf-home` > auto_home.c

auto_home.o: \
compile auto_home.c
	./compile auto_home.c

byte_copy.o: \
compile byte_copy.c byte.h
	./compile byte_copy.c

byte_cr.o: \
compile byte_cr.c byte.h
	./compile byte_cr.c

check: \
it instcheck
	./instcheck

compile: \
make-compile warn-auto.sh systype
	( cat warn-auto.sh; ./make-compile "`cat systype`" ) > \
	compile
	chmod 755 compile

complex4.0: \
complex4.3
	nroff -man complex4.3 > complex4.0

complex8.0: \
complex8.3
	nroff -man complex8.3 > complex8.0

djbfft.a: \
makelib sqrthalf.o fftc8_r32.o fftc8_r64.o fftc8_r128.o fftc8_r256.o \
fftc8_r512.o fftc8_r1024.o fftc8_r1024.o fftc8_r2048.o fftc8_r4096.o \
fftc8_r8192.o fftc8_r16384.o fftc8_r32768.o fftc8_r65536.o \
fftc4_r32.o fftc4_r64.o fftc4_r128.o fftc4_r256.o fftc4_r512.o \
fftc4_r1024.o fftc4_r2048.o fftc4_r4096.o fftc4_r8192.o \
fftc4_r16384.o fftc4_r32768.o fftc4_r65536.o fftc4.o fftc4_32.o \
fftc4_64.o fftc4_128.o fftc4_256.o fftc4_512.o fftc4_1024.o \
fftc4_2048.o fftc4_4096.o fftc4_8192.o fftc4_16384.o fftc4_32768.o \
fftc4_65536.o fftc8.o fftc8_32.o fftc8_64.o fftc8_128.o fftc8_256.o \
fftc8_512.o fftc8_1024.o fftc8_2048.o fftc8_4096.o fftc8_8192.o \
fftc8_16384.o fftc8_32768.o fftc8_65536.o scalec4.o multiplyc4.o \
multiplyr4.o scalec8.o multiplyc8.o multiplyr8.o fftorder_2.o \
fftorder_4.o fftorder_8.o fftorder_16.o fftorder_32.o fftorder_64.o \
fftorder_128.o fftorder_256.o fftorder_512.o fftorder_1024.o \
fftorder_2048.o fftorder_4096.o fftorder_8192.o
	./makelib djbfft.a sqrthalf.o fftc8_r32.o fftc8_r64.o \
	fftc8_r128.o fftc8_r256.o fftc8_r512.o fftc8_r1024.o \
	fftc8_r1024.o fftc8_r2048.o fftc8_r4096.o fftc8_r8192.o \
	fftc8_r16384.o fftc8_r32768.o fftc8_r65536.o fftc4_r32.o \
	fftc4_r64.o fftc4_r128.o fftc4_r256.o fftc4_r512.o \
	fftc4_r1024.o fftc4_r2048.o fftc4_r4096.o fftc4_r8192.o \
	fftc4_r16384.o fftc4_r32768.o fftc4_r65536.o fftc4.o \
	fftc4_32.o fftc4_64.o fftc4_128.o fftc4_256.o fftc4_512.o \
	fftc4_1024.o fftc4_2048.o fftc4_4096.o fftc4_8192.o \
	fftc4_16384.o fftc4_32768.o fftc4_65536.o fftc8.o \
	fftc8_32.o fftc8_64.o fftc8_128.o fftc8_256.o fftc8_512.o \
	fftc8_1024.o fftc8_2048.o fftc8_4096.o fftc8_8192.o \
	fftc8_16384.o fftc8_32768.o fftc8_65536.o scalec4.o \
	multiplyc4.o multiplyr4.o scalec8.o multiplyc8.o \
	multiplyr8.o fftorder_2.o fftorder_4.o fftorder_8.o \
	fftorder_16.o fftorder_32.o fftorder_64.o fftorder_128.o \
	fftorder_256.o fftorder_512.o fftorder_1024.o \
	fftorder_2048.o fftorder_4096.o fftorder_8192.o

error.a: \
makelib error.o error_str.o
	./makelib error.a error.o error_str.o

error.o: \
compile error.c error.h
	./compile error.c

error_str.o: \
compile error_str.c error.h
	./compile error_str.c

fftc4.0: \
fftc4.3
	nroff -man fftc4.3 > fftc4.0

fftc4.o: \
compile fftc4.c fftc4.h complex4.h real4.h sqrthalf.h real4.h real8.h \
fft.c fft.c.opt fft_small.c
	./compile fftc4.c

fftc4_1024.o: \
compile fftc4_1024.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_1024.c

fftc4_128.o: \
compile fftc4_128.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_128.c

fftc4_16384.o: \
compile fftc4_16384.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_16384.c

fftc4_2048.o: \
compile fftc4_2048.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_2048.c

fftc4_256.o: \
compile fftc4_256.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_256.c

fftc4_32.o: \
compile fftc4_32.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_32.c

fftc4_32768.o: \
compile fftc4_32768.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_32768.c

fftc4_4096.o: \
compile fftc4_4096.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_4096.c

fftc4_512.o: \
compile fftc4_512.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_512.c

fftc4_64.o: \
compile fftc4_64.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_64.c

fftc4_65536.o: \
compile fftc4_65536.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_65536.c

fftc4_8192.o: \
compile fftc4_8192.c fftc4_impl.h fftc4.h complex4.h real4.h
	./compile fftc4_8192.c

fftc4_r1024.o: \
compile fftc4_r1024.c fftc4.h complex4.h real4.h fft_r1024.c
	./compile fftc4_r1024.c

fftc4_r128.o: \
compile fftc4_r128.c fftc4.h complex4.h real4.h fft_r128.c
	./compile fftc4_r128.c

fftc4_r16384.o: \
compile fftc4_r16384.c fftc4.h complex4.h real4.h fft_r16384.c
	./compile fftc4_r16384.c

fftc4_r2048.o: \
compile fftc4_r2048.c fftc4.h complex4.h real4.h fft_r2048.c
	./compile fftc4_r2048.c

fftc4_r256.o: \
compile fftc4_r256.c fftc4.h complex4.h real4.h fft_r256.c
	./compile fftc4_r256.c

fftc4_r32.o: \
compile fftc4_r32.c fftc4.h complex4.h real4.h fft_r32.c
	./compile fftc4_r32.c

fftc4_r32768.o: \
compile fftc4_r32768.c fftc4.h complex4.h real4.h fft_r32768.c
	./compile fftc4_r32768.c

fftc4_r4096.o: \
compile fftc4_r4096.c fftc4.h complex4.h real4.h fft_r4096.c
	./compile fftc4_r4096.c

fftc4_r512.o: \
compile fftc4_r512.c fftc4.h complex4.h real4.h fft_r512.c
	./compile fftc4_r512.c

fftc4_r64.o: \
compile fftc4_r64.c fftc4.h complex4.h real4.h fft_r64.c
	./compile fftc4_r64.c

fftc4_r65536.o: \
compile fftc4_r65536.c fftc4.h complex4.h real4.h fft_r65536.c
	./compile fftc4_r65536.c

fftc4_r8192.o: \
compile fftc4_r8192.c fftc4.h complex4.h real4.h fft_r8192.c
	./compile fftc4_r8192.c

fftc8.0: \
fftc8.3
	nroff -man fftc8.3 > fftc8.0

fftc8.o: \
compile fftc8.c fftc8.h complex8.h real8.h sqrthalf.h real4.h real8.h \
fft.c fft.c.opt fft_small.c
	./compile fftc8.c

fftc8_1024.o: \
compile fftc8_1024.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_1024.c

fftc8_128.o: \
compile fftc8_128.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_128.c

fftc8_16384.o: \
compile fftc8_16384.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_16384.c

fftc8_2048.o: \
compile fftc8_2048.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_2048.c

fftc8_256.o: \
compile fftc8_256.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_256.c

fftc8_32.o: \
compile fftc8_32.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_32.c

fftc8_32768.o: \
compile fftc8_32768.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_32768.c

fftc8_4096.o: \
compile fftc8_4096.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_4096.c

fftc8_512.o: \
compile fftc8_512.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_512.c

fftc8_64.o: \
compile fftc8_64.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_64.c

fftc8_65536.o: \
compile fftc8_65536.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_65536.c

fftc8_8192.o: \
compile fftc8_8192.c fftc8_impl.h fftc8.h complex8.h real8.h
	./compile fftc8_8192.c

fftc8_r1024.o: \
compile fftc8_r1024.c fftc8.h complex8.h real8.h fft_r1024.c
	./compile fftc8_r1024.c

fftc8_r128.o: \
compile fftc8_r128.c fftc8.h complex8.h real8.h fft_r128.c
	./compile fftc8_r128.c

fftc8_r16384.o: \
compile fftc8_r16384.c fftc8.h complex8.h real8.h fft_r16384.c
	./compile fftc8_r16384.c

fftc8_r2048.o: \
compile fftc8_r2048.c fftc8.h complex8.h real8.h fft_r2048.c
	./compile fftc8_r2048.c

fftc8_r256.o: \
compile fftc8_r256.c fftc8.h complex8.h real8.h fft_r256.c
	./compile fftc8_r256.c

fftc8_r32.o: \
compile fftc8_r32.c fftc8.h complex8.h real8.h fft_r32.c
	./compile fftc8_r32.c

fftc8_r32768.o: \
compile fftc8_r32768.c fftc8.h complex8.h real8.h fft_r32768.c
	./compile fftc8_r32768.c

fftc8_r4096.o: \
compile fftc8_r4096.c fftc8.h complex8.h real8.h fft_r4096.c
	./compile fftc8_r4096.c

fftc8_r512.o: \
compile fftc8_r512.c fftc8.h complex8.h real8.h fft_r512.c
	./compile fftc8_r512.c

fftc8_r64.o: \
compile fftc8_r64.c fftc8.h complex8.h real8.h fft_r64.c
	./compile fftc8_r64.c

fftc8_r65536.o: \
compile fftc8_r65536.c fftc8.h complex8.h real8.h fft_r65536.c
	./compile fftc8_r65536.c

fftc8_r8192.o: \
compile fftc8_r8192.c fftc8.h complex8.h real8.h fft_r8192.c
	./compile fftc8_r8192.c

fftorder.0: \
fftorder.3
	nroff -man fftorder.3 > fftorder.0

fftorder_1024.o: \
compile fftorder_1024.c fftorder.h
	./compile fftorder_1024.c

fftorder_128.o: \
compile fftorder_128.c fftorder.h
	./compile fftorder_128.c

fftorder_16.o: \
compile fftorder_16.c fftorder.h
	./compile fftorder_16.c

fftorder_2.o: \
compile fftorder_2.c fftorder.h
	./compile fftorder_2.c

fftorder_2048.o: \
compile fftorder_2048.c fftorder.h
	./compile fftorder_2048.c

fftorder_256.o: \
compile fftorder_256.c fftorder.h
	./compile fftorder_256.c

fftorder_32.o: \
compile fftorder_32.c fftorder.h
	./compile fftorder_32.c

fftorder_4.o: \
compile fftorder_4.c fftorder.h
	./compile fftorder_4.c

fftorder_4096.o: \
compile fftorder_4096.c fftorder.h
	./compile fftorder_4096.c

fftorder_512.o: \
compile fftorder_512.c fftorder.h
	./compile fftorder_512.c

fftorder_64.o: \
compile fftorder_64.c fftorder.h
	./compile fftorder_64.c

fftorder_8.o: \
compile fftorder_8.c fftorder.h
	./compile fftorder_8.c

fftorder_8192.o: \
compile fftorder_8192.c fftorder.h
	./compile fftorder_8192.c

find-systype: \
find-systype.sh auto-ccld.sh
	cat auto-ccld.sh find-systype.sh > find-systype
	chmod 755 find-systype

hasgethr.h: \
trygethr.c compile load
	( ( ./compile trygethr.c && ./load trygethr ) >/dev/null \
	2>&1 \
	&& echo \#define HASGETHRTIME 1 || exit 0 ) > hasgethr.h
	rm -f trygethr.o

hasrdtsc.h: \
tryrdtsc.c compile load
	( ( ./compile tryrdtsc.c && ./load tryrdtsc && ./tryrdtsc \
	) >/dev/null 2>&1 \
	&& echo \#define HASRDTSC 1 || exit 0 ) > hasrdtsc.h
	rm -f tryrdtsc.o tryrdtsc

hier.o: \
compile hier.c auto_home.h
	./compile hier.c

install: \
load install.o auto_home.o hier.o strerr.a substdio.a open.a error.a \
str.a
	./load install auto_home.o hier.o strerr.a substdio.a \
	open.a error.a str.a 

install.o: \
compile install.c substdio.h strerr.h error.h open.h readwrite.h \
exit.h
	./compile install.c

instcheck: \
load instcheck.o hier.o auto_home.o strerr.a substdio.a error.a str.a
	./load instcheck hier.o auto_home.o strerr.a substdio.a \
	error.a str.a 

instcheck.o: \
compile instcheck.c strerr.h error.h readwrite.h exit.h
	./compile instcheck.c

it: \
man accuracy accuconv speed speedconv

load: \
make-load warn-auto.sh systype
	( cat warn-auto.sh; ./make-load "`cat systype`" ) > load
	chmod 755 load

make-compile: \
make-compile.sh auto-ccld.sh
	cat auto-ccld.sh make-compile.sh > make-compile
	chmod 755 make-compile

make-load: \
make-load.sh auto-ccld.sh
	cat auto-ccld.sh make-load.sh > make-load
	chmod 755 make-load

make-makelib: \
make-makelib.sh auto-ccld.sh
	cat auto-ccld.sh make-makelib.sh > make-makelib
	chmod 755 make-makelib

makelib: \
make-makelib warn-auto.sh systype
	( cat warn-auto.sh; ./make-makelib "`cat systype`" ) > \
	makelib
	chmod 755 makelib

man: \
fftc4.0 fftc8.0 fftorder.0 multiplyc4.0 multiplyc8.0 multiplyr4.0 \
multiplyr8.0 complex4.0 complex8.0 real4.0 real8.0 scalec4.0 \
scalec8.0

multiplyc4.0: \
multiplyc4.3
	nroff -man multiplyc4.3 > multiplyc4.0

multiplyc4.o: \
compile multiplyc4.c complex4.h real4.h multiplyc4.h
	./compile multiplyc4.c

multiplyc8.0: \
multiplyc8.3
	nroff -man multiplyc8.3 > multiplyc8.0

multiplyc8.o: \
compile multiplyc8.c complex8.h real8.h multiplyc8.h
	./compile multiplyc8.c

multiplyr4.0: \
multiplyr4.3
	nroff -man multiplyr4.3 > multiplyr4.0

multiplyr4.o: \
compile multiplyr4.c multiplyr4.h real4.h complex4.h real4.h fftc4.h \
complex4.h sqrthalf.h real4.h real8.h multiplyr.c
	./compile multiplyr4.c

multiplyr8.0: \
multiplyr8.3
	nroff -man multiplyr8.3 > multiplyr8.0

multiplyr8.o: \
compile multiplyr8.c multiplyr8.h real8.h complex8.h real8.h fftc8.h \
complex8.h sqrthalf.h real4.h real8.h multiplyr.c
	./compile multiplyr8.c

open.a: \
makelib open_read.o open_trunc.o
	./makelib open.a open_read.o open_trunc.o

open_read.o: \
compile open_read.c open.h
	./compile open_read.c

open_trunc.o: \
compile open_trunc.c open.h
	./compile open_trunc.c

real4.0: \
real4.3
	nroff -man real4.3 > real4.0

real8.0: \
real8.3
	nroff -man real8.3 > real8.0

scalec4.0: \
scalec4.3
	nroff -man scalec4.3 > scalec4.0

scalec4.o: \
compile scalec4.c scalec4.h complex4.h real4.h
	./compile scalec4.c

scalec8.0: \
scalec8.3
	nroff -man scalec8.3 > scalec8.0

scalec8.o: \
compile scalec8.c scalec8.h complex8.h real8.h
	./compile scalec8.c

setup: \
it install
	./install

speed: \
load speed.o djbfft.a
	./load speed djbfft.a 

speed.o: \
compile speed.c fftc4.h complex4.h real4.h fftc8.h complex8.h real8.h \
timing.h hasrdtsc.h hasgethr.h
	./compile speed.c

speedconv: \
load speedconv.o djbfft.a
	./load speedconv djbfft.a 

speedconv.o: \
compile speedconv.c fftc4.h complex4.h real4.h fftc8.h complex8.h \
real8.h multiplyc4.h multiplyc8.h multiplyr4.h multiplyr8.h timing.h \
hasrdtsc.h hasgethr.h
	./compile speedconv.c

sqrthalf.o: \
compile sqrthalf.c sqrthalf.h real4.h real8.h
	./compile sqrthalf.c

str.a: \
makelib str_len.o str_cpy.o byte_copy.o byte_cr.o
	./makelib str.a str_len.o str_cpy.o byte_copy.o byte_cr.o

str_cpy.o: \
compile str_cpy.c str.h
	./compile str_cpy.c

str_len.o: \
compile str_len.c str.h
	./compile str_len.c

strerr.a: \
makelib strerr_sys.o strerr_die.o
	./makelib strerr.a strerr_sys.o strerr_die.o

strerr_die.o: \
compile strerr_die.c substdio.h subfd.h substdio.h exit.h strerr.h
	./compile strerr_die.c

strerr_sys.o: \
compile strerr_sys.c error.h strerr.h
	./compile strerr_sys.c

subfderr.o: \
compile subfderr.c readwrite.h substdio.h subfd.h substdio.h
	./compile subfderr.c

substdi.o: \
compile substdi.c substdio.h byte.h error.h
	./compile substdi.c

substdio.a: \
makelib substdio.o substdi.o substdo.o subfderr.o substdio_copy.o
	./makelib substdio.a substdio.o substdi.o substdo.o \
	subfderr.o substdio_copy.o

substdio.o: \
compile substdio.c substdio.h
	./compile substdio.c

substdio_copy.o: \
compile substdio_copy.c substdio.h
	./compile substdio_copy.c

substdo.o: \
compile substdo.c substdio.h str.h byte.h error.h
	./compile substdo.c

systype: \
find-systype trycpp.c
	./find-systype > systype
