# Project:	PlayIt

CC	=	cc
AS	=	objasm -throwback -apcs 3/32bit
LK	=	link -rescan
#LK	=	drlink -no -rescan
CCFLAGS	=	-apcs 3/32bit -c -depend !Depend -IC: -throwback -D__swi -fafh
ASFLAGS	=	-throwback

# macros for the library
LIB	=	o.PlayIt
LIBOBJS	=	o.playitv o.playitap
CLIB	=	C:o.stubs

# macrosf for the test program
TEST	=	Test
ENSURE32 =	PlayIt:Ensure32
ENSURE26 =	PlayIt:Ensure26

.SUFFIXES:	.o .c .s

# Final targets:
PlayIt:		$(LIB) $(TEST) $(ENSURE32) $(ENSURE26)

# how to make the main library file
$(LIB):		$(LIBOBJS)
		LibFile -c -o $@ $(LIBOBJS)

# how to make the test program
$(TEST):	o.test $(LIB)
		$(LK) -o $@ o.test $(LIB) C:o.stubs

# how to make the 32-bit ensure program
$(ENSURE32):	o.ensure $(LIB)
		$(LK) -o $@ o.ensure $(LIB) C:o.stubs

# how to make the 26-bit ensure program
$(ENSURE26):	o.ensure $(LIB)
		$(LK) -o $@ o.ensure $(LIB) C:o.stubs

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

# Dynamic dependencies:
o.ensure:	C:h.kernel
o.ensure:	c.ensure
o.ensure:	h.playit
o.ensure:	h.playitap
o.playitap:	C:h.kernel
o.playitap:	c.playitap
o.playitap:	h.playit
o.playitap:	h.playitap
o.test:	C:h.kernel
o.test:	c.test
o.test:	h.playit
o.test:	h.playitap
