/*
 * Rules for DSP tools
 */
.SUFFIXES: .cld .cln .lod .c .asm

.cld.lod:
	${CLDLOD} $< > $@
.c.cln:
	${G56K} -g -O -c -o $@ $(G56KFLAGS) $<
.asm.cln:
	${G56K} -g -O -c -o $@ $(G56KFLAGS) $<

G56K	= ${DSPTOOLROOT}/bin/g56k
ASM56K	= ${DSPTOOLROOT}/dsp/bin/asm56000
LINK56K	= ${DSPTOOLROOT}/dsp/bin/dsplnk
#CLDLOD	= ${DSPTOOLROOT}/bin/cldlod
CLDLOD	= cldlod
#DSPLIB	= ${DSPTOOLROOT}/bin/dsplib
DSPLIB	= dsplib

/*
 *
 */
LODFILES=Ajvmain.lod

none:

all:: $(LODFILES)

dsp.asm: ../dsp.h
	/lib/cpp -P ../dsp.h >dsp.asm

Ajvmain.cln: Ajvmain.asm dsp.asm
	$(ASM56K) -L -I../../include -c -B Ajvmain.cln -- Ajvmain.asm

Ajvmain.cld: Ajvmain.cln
	$(LINK56K) -M -c -g -R /usr/local/dsp/lib/map56 -B Ajvmain.cld -- Ajvmain.cln

install::
	@case '${MFLAGS}' in *[i]*) set +e;; esac; \
	for i in $(LODFILES); do \
		(set -x; $(INSTALL) -c $(INSTLIBFLAGS) $$i $(LODDIR)); \
	done

clean::
	rm -f *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut

completely_clean::
	make clean
	rm -f *.lod *.cld *.cln *.map *.lst


# DO NOT DELETE THIS LINE -- make depend depends on it.
