# Makefile for msdos using microsoft c5.1 and masm.
#
#

CFLAGS= -Oint -Gs -AL -DFAR=far -DNEAR=near

all:	progs times
progs:	fftgc.exe fftgf.exe fftg86.exe
times:	fft1c.exe fft1f.exe fft1a.exe 

demos:	fft2c.exe fft2f.exe fft2a.exe
fft:	fft8ca.obj fft8f.obj fftsubs.obj fft886.obj
foreign: fft832.s fft868.asm

#
# The generator programs
#

fftgc.exe:	fftg.obj fftoutc.obj
	cl -Fefftgc fftg.obj fftoutc.obj

fftgf.exe:	fftg.obj fftoutf.obj
	cl -Fefftgf fftg.obj fftoutf.obj

#
# Generators of assembly
#

fftg86.exe:	fftg.obj fftout86.obj
	cl -Fefftg86 fftg.obj fftout86.obj

fftg32.exe:	fftg.obj fftout32.obj
	cl -Fefftg32 fftg.obj fftout32.obj

fftg68.exe:	fftg.obj fftout68.obj
	cl -Fefftg68 fftg.obj fftout68.obj

#
# generated files
#

fft8ca.c:	fftgc.exe
	fftgc fft8c 8 fft
	for %i in (fft8c?.c) do cl -c $(CFLAGS) %i

fft8f.obj:	fft8f.c
	cl -c $(CFLAGS) fft8f.c

fft8f.c:	fftgf.exe
	fftgf fft8f 8 fft

#
# generated files (assembly)
#

fft886.obj:	fft886.asm fftsub86.mac
	masm /Ml fft886,,NUL,NUL;

fft886.asm:	fftg86.exe
	fftg86 fft886 8 fft

fft832.s:	fftg32.exe
	fftg32 fft832 8 fft

fft868.asm:	fftg68.exe
	fftg68 fft868 8 fft

#
# test programs
#

fft2c.exe:	fft2.obj isqrt.obj fft8c*.obj
	cl -Fefft2c fft2.obj isqrt.obj fft8c*.obj

fft2f.exe:	fft2.obj isqrt.obj fft8f.obj fftsubs.obj
	cl -Fefft2f fft2.obj isqrt.obj fft8f.obj fftsubs.obj

fft2a.exe:	fft2.obj isqrt.obj fft886.obj
	cl -Fefft2a fft2.obj isqrt.obj fft886.obj

#
# timing programs
#

fft1c.exe:	fft1.obj fft8ca.obj
	cl -Fefft1c fft1.obj fft8c*.obj

fft1f.exe:	fft1.obj fft8f.obj fftsubs.obj
	cl -Fefft1f fft1.obj fft8f.obj fftsubs.obj

fft1a.exe:	fft1.obj fft886.obj
	cl -Fefft1a fft1.obj fft886.obj

#
# package all files
#

MISC= MANIFEST README readme.udi makefile.*
FFTPROGS= fftg.c fftoutf.c fftsubs.c fftoutc.c fftsubs.h
FFTASM= fftout86.c fftsub86.mac fftout32.c fftout68.c fftsubs.h86
TESTS= fft2.pc fft2.ami isqrt.c fft1.c fft8f.c
DATA= d?.fft
TAR= $(FFTPROGS) $(FFTASM) $(TESTS) $(DATA) $(MISC)

zip:		fft.uue

fft_zip.uue:	fft.zip
	uue fft.zip

fft.zip:	$(TAR)
	del fft.zip
	pkzip fft $(MISC)
	pkzip fft $(FFTPROGS)
	pkzip fft $(FFTASM)
	pkzip fft $(TESTS)
	pkzip fft $(DATA)

fft_tar:	$(TAR)
	md _tmp_
	for %i in ($(MISC)) do copy %i _tmp_
	for %i in ($(FFTPROGS)) do copy %i _tmp_
	for %i in ($(FFTASM)) do copy %i _tmp_
	for %i in ($(TESTS)) do copy %i _tmp_
	for %i in ($(DATA)) do copy %i _tmp_
	cd _tmp_
	tar cf ..\fft_tar .
	cd ..
	echo y|del _tmp_
	rd _tmp_

fft_tar.z:	fft_tar
	compress -b13 fft_tar

fft_tar.uue:	fft_tar.z
	uue fft_tar.z

