###
### Makefile for the FAST sub library
###

lib:= xpkFAST.library
ARCHIV:= xpkFAST_V1.03.lha

### The Assembler:  BAsm, A68K, dasm, as, PhxAss, ...
#AS:=

### Assembler flags:
#AFLAGS:= -O -OT -OG				# for BAsm
#AFLAGS:= -f -q -iinclude:,xpk:include		# for A68k

### The linker: SLink, BLink, PhxLnk
#LD:=

### Linker flags:
#LDFLAGS:=SC SD ND

### A C-Compiler often comes handy: gcc, dcc, sc, lc, cc, ...
#CC:=
#CFLAGS:=-pipe -m486 -O6 -fomit-frame-pointer -Wall	# for gcc

### all files which have to be in the distribution
ARCHIV_FILES:=	xpkFAST.library FAST.doc ToDo Makefile ChangeLog \
		FAST.i xpkFAST.s FASTmisc.s compress.s compress2.s decompress.s

### The objects for the .library
OBJ_FILES:= xpkFAST.o FASTmisc.o compress.o compress2.o decompress.o

#####################################################################
### The default target is to build the library

all: $(lib)

#####################################################################
### Make the real library

$(lib): $(OBJ_FILES)
	$(LD) $(LDFLAGS) \
	TO $(lib) \
	LIB lib:amiga.lib \
	FROM $(OBJ_FILES)

#####################################################################
### Install the library and flush [unused] old versions.

install: $(lib)
	Copy $(lib) libs:compressors
	Avail FLUSH

#####################################################################
### Build the distribution.

dist: $(ARCHIV)

$(ARCHIV):  $(ARCHIV_FILES)
	lha u $(ARCHIV) $(ARCHIV_FILES)


#####################################################################
### Development testtools

sctest : sctest.o scompress.o sdecompress.o
	$(CC) -o $@ $^

#####################################################################
### Cleanup

clean:
	-$(RM) $(OBJ_FILES)

realclean: clean
	-$(RM) $(lib)

#####################################################################
#####################################################################
### Dependencies

compress.o	: compress.s
compress2.o	: compress2.s
decompress.o	: decompress.s
xpkFAST.o	: xpkFAST.s FAST.i
FASTmisc.o	: FASTmisc.s FAST.i

scompress.o	: scompress.c FAST.h
sdecompress.o	: sdecompress.c FAST.h
sctest.o	: sctest.c FAST.h
