# Project:	PlayIt

CC	=	cc
AS	=	asm
LK	=	drlink
CCFLAGS	=	-c -depend !Depend -IOS: -IC: -throwback -D__swi -fafh
ASFLAGS	=	-throwback
LKFLAGS	=	-no -rescan

# macros for the library
LIBFILE	=	o.PlayIt
LIBS	=	o.playitv o.playitap
CLIB	=	C:o.GCCstubs
OSLIB	=	OSLib:o.OSLib

# macrosf for the test program
TEST	=	Test
ENSURE	=	PlayIt:Ensure

.SUFFIXES:	.o .c .s

# Final targets:
PlayIt:		$(LIBFILE) $(TEST) $(ENSURE)

# how to make the main library file
$(LIBFILE):	$(LIBS)
		LibFile -c -o $(LIBFILE) $(LIBS)

# how to make the test program
$(TEST):	o.test $(LIBFILE)
		$(LK) $(LKFLAGS) -o $(TEST) o.test $(LIBFILE) $(CLib)

# how to make the ensure program
$(ENSURE):	o.ensure $(LIBFILE)
		$(LK) $(LKFLAGS) -o $(ENSURE) o.ensure $(LIBFILE) $(CLib) $(OSLIB)

# how to make independent object files
.c.o:;		$(CC) $(CCFLAGS) -o $@ $<
.s.o:;		$(AS) $(ASFLAGS) -o $@ $<

# Dynamic dependencies:
o.test:	c.test
o.test:	C:h.kernel
o.test:	h.playitap
o.test:	h.playit
o.playitap:	c.playitap
o.playitap:	h.playitap
o.playitap:	h.playit
o.playitap:	C:h.kernel
o.ensure:	c.ensure
o.ensure:	OS:h.os
o.ensure:	OS:h.types
o.ensure:	OS:h.wimp
o.ensure:	OS:h.osspriteop
o.ensure:	OS:h.font
o.ensure:	h.playitap
o.ensure:	h.playit
