# Makefile for msdos using microsoft c and masm.
#
#

CFLAGS= -Oint -Gs -AL
LIBS=

all:	progs tests
progs:	fftgc.exe fftgf.exe fftga.exe
fft:	fft256c.obj fft256f.obj fftsubs.obj fft256a.obj
tests:	fft2c.exe fft2f.exe fft2a.obj

#
# The generator programs
#

fftgc.exe:	fftg.obj fftoutc.obj
	cl -Fefftgc fftg.obj fftoutc.obj $(LIBS)

fftgf.exe:	fftg.obj fftoutf.obj
	cl -Fefftgf fftg.obj fftoutf.obj $(LIBS)

fftga.exe:	fftg.obj fftouta.obj
	cl -Fefftga fftg.obj fftouta.obj $(LIBS)

#
# generated files
#

fft256c.obj:	fft256c.c fftsubs.h
	cl -c $(CFLAGS) fft256c.c

fft256c.c:	fftgc.exe
	fftgc fft256c 8 fft

fft256f.obj:	fft256f.c
	cl -c $(CFLAGS) fft256f.c

fft256f.c:	fftgf.exe
	fftgf fft256f 8 fft

fft256a.obj:	fft256a.asm fftouta.mac
	masm /Ml fft256a,,NUL,NUL;

fft256a.asm:	fftga.exe
	fftga fft256s 8 fft

#
# test programs
#

fft2c.exe:	fft2.obj fft256c.obj
	cl -Fefft2c fft2.obj fft256c.obj $(LIBS)

fft2f.exe:	fft2.obj fft256f.obj fftsubs.obj
	cl -Fefft2f fft2.obj fft256f.obj fftsubs.obj $(LIBS)

fft2a.exe:	fft2.obj fft256a.obj
	cl -Fefft2s fft2.obj fft256a.obj

#
# cut a tar file
#

tar:		ffttar.uue

ffttar.uue:	fft_tar.Z
	uue fft_tar.Z >ffttar.uue

fft_tar.Z:	fft_tar
	compress fft_tar

FFTPROGS= fftg.c fftoutf.c fftoutc.c fftsubs.c fftsubs.h
FFTASM= fftouts.c fftouta.c fftouta.mac
TESTS= fft2.c fft256c.c fft256f.c
DATA= data1.fft data2.fft
MISC= makefile README MANIFEST
TAR= $(FFTPROGS) $(TESTS) $(DATA) $(MISC)

fft_tar:	$(TAR)
	tar cvf fft_tar $(TAR)

#
# cut an arc file
#

arc:		fftarc.uue

fftarc.uue:	fft.arc
	uue fft.arc >fftarc.uue

fft.arc:	$(TAR)
	del fft.arc
	pkarc -a fft $(FFTPROGS)
	pkarc -a fft $(TESTS)
	pkarc -a fft $(DATA)
	pkarc -a fft $(MISC)

#
# temp progs to test machine instruction timing in a tight loop.
#

loop.obj:	loop.s

speed:	speed.obj loop.obj
	cc -o speed speed.obj loop.obj
