CC	= m68k-palmos-coff-gcc
#CFLAGS	= -O1 -DPCOMP_SHLIB
#CFLAGS	= -O1
CFLAGS	= -O -g
#OBJ	= main.o
OBJ	= main.o pcomp.o

#all:	PCompLib.prc PCompress.prc
all:	PCompress.prc

PCompLib.prc: pcomp.o
	m68k-palmos-coff-ld -shared -o PCompLib pcomp.o
	m68k-palmos-coff-obj-res PCompLib
	rm -f {code,pref,data}0000.PCompLib.grc
	mv code0001.PCompLib.grc libr0000.PCompLib.grc
	build-prc -t libr PCompLib.prc PCompLib PCom libr0000.PCompLib.grc

PCompress.prc: PCompress tfrm03e8.bin
	build-prc PCompress.prc PCompress PCom *.PCompress.grc *.bin

PCompress: $(OBJ)
	$(CC) $(CFLAGS) -o PCompress $(OBJ)
	m68k-palmos-coff-obj-res PCompress

tfrm03e8.bin: gui.rcp gui.h
	pilrc gui.rcp 

clean:
	rm -f *.grc *.bin *.o PCompLib PCompress

main.o:		pcomp.h header.h dbinfo.h gui.h
pcomp.o:	pcomp.h pcomp_int.h
