#
# Makefile for the FEAL sub library
#

AS = a68k -q

lib = xpkFEAL.library
inc = include:libraries/xpk.h include:libraries/xpksub.h \
      FEAL.h FEAL_asm.h WordOps.h

#opt = -rr -d4 -v -tc -cfqm -j30i -j88i -ms
opt = -rs -d4 -v -tc -cfqm -j30i -j88i -mt

all: $(lib) test

#
# Makes the real library
#
$(lib): xpkFEAL.o FEAL.o WordOps.o FEAL_asm.o /include/xpksub.fd
	BLINK SC SD LIBPREFIX _ LIBFD /include/xpksub.fd TO $(lib) \
	FROM lib:libent.o lib:libinit.o xpkFEAL.o FEAL.o WordOps.o FEAL_asm.o \
	LIB lib:lc.lib NOICONS ND
	Copy $(lib) libs:compressors
	Avail FLUSH

xpkFEAL.o: xpkFEAL.c $(inc)
	lc $(opt) -ml xpkFEAL.c

#
# Makes the linked test program
#
test: test.o FEAL.o WordOps.o FEAL_asm.o
	BLINK TO test LIB lib:lc.lib FROM lib:catch.o \
	test.o FEAL.o WordOps.o FEAL_asm.o \
	NOICONS

test.o: test.c $(inc)
	lc $(opt) test.c

FEAL.o: FEAL.c $(inc)
    lc $(opt) FEAL.c

WordOps.o: WordOps.c $(inc)
    lc $(opt) WordOps.c

FEAL_asm.o: FEAL_asm.s
    $(AS) FEAL_asm.s

#
# Cleanup
#

clean:
	-Delete "#?.o"
	-Delete test
