#
# Makefile for xpk clients
#

inc = include:libraries/xpk.h    \
      include:libraries/xpksub.h \
      include:proto/powerpacker.h

lib = libs:xpkmaster.library \
      libs:xpkBLZW.library   \
      libs:powerpacker.library

opt = -v -cfq -ms

tiny= DEFINE __main=__tinymain 

#
# Compile all clients
#
release: xpk xup xType xDir xQuery

#
# Clean up for distribution
#
clean: XPK xType
	BLink from XPK to t:XPK nodebug
	Copy t:XPK XPK clone
	BLink from xType to t:xType nodebug
	Copy t:xType xType clone
	-Delete xType.o
	-Delete xpk.o

#
# Client #1: Standard file-to-file compressor
#

xpk: xpk.o $(inc)
	BLINK FROM lib:cres.o XPK.o TO xpk noicons ND\
		LIB lib:amiga.lib lib:lc.lib /lib/xpksas.lib lib:debug.lib  ND

xpk.o: xpk.c $(inc) makefile
	lc $(opt) -d3 XPK.c 


#
# Client #2: Standard file-to-file decompressor
#
xup: xup.o $(inc)
	BLINK $(tiny) FROM lib:cres.o xup.o TO xup noicons ND \
		LIB lib:amiga.lib lib:lc.lib /lib/xpksas.lib

xup.o: xup.c $(inc) makefile
	lc $(opt) -d3 xup.c 


#
# Client #3: Standard file-to-stdout file decompressor
#
xType: xType.o $(inc)
	BLINK $(tiny) FROM lib:cres.o xType.o TO xType noicons ND \
		LIB /lib/xpksas.lib lib:lc.lib 

xType.o: xType.c $(inc) makefile
	lc $(opt) xType.c 

#
# Client #4: Re-packer
#

xrepack: xrepack.o
	BLINK $(tiny) FROM lib:cres.o xrepack.o TO XRepack noicons ND \
		LIB /lib/xpksas.lib lib:lc.lib 

xrepack.o: XRepack.c $(inc) makefile
	lc $(opt) XRepack.c 

#
# Client #5: A 'dir' program
#

xDir: xDir.o
	BLINK $(tiny) FROM lib:cres.o xDir.o TO xDir noicons ND \
		LIB /lib/xpksas.lib lib:amiga.lib lib:lc.lib MAP ram:mapfile

xDir.o: xDir.c $(inc) makefile
	lc -v -j100i -d3 $(opt) xDir.c 


#
# Client #6: A packer info displayer
#

xQuery: xQuery.c $(inc)
	lc -d3 $(opt) xQuery.c 
	BLINK FROM lib:cres.o xQuery.o TO xQuery noicons \
		LIB /lib/xpksas.lib lib:amiga.lib lib:lc.lib ND






#
# Update include files from /include to include:
#
include:libraries/xpk.h: /include/libraries/xpk.h
	Copy /include/libraries/xpk.h include:libraries

include:libraries/xpksub.h: /include/libraries/xpksub.h
	Copy /include/libraries/xpksub.h include:libraries

include:proto/powerpacker.h: /include/proto/powerpacker.h
	Copy /include/proto/powerpacker.h include:proto

#
# Update libraries from /libs to libs:
#
libs:xpkmaster.library: /libs/xpkmaster.library
	Copy /libs/xpkmaster.library libs:

libs:xpkBLZW.library: /libs/xpkBLZW.library
	Copy /libs/xpkBLZW.library libs:
