##########################################################################
#
# $Id: lmkfile,v 39.18 92/10/12 12:09:52 chrisg Exp $
#
##########################################################################

VERSION=	39
V=		v:
SRCDIRPATH=	kickstart/graphics
SRCDIR=		c
SUBSYSNAME= 	c
SUBSYSGROUP=	graphics
OBJDIR=ram:$(SUBSYSNAME)objs
OBJSTORE=objs
DESTDIR=v$(VERSION):src/kickstart/graphics/c

.asm.obj:
	spp $*.asm >ram:tmp1.asm
	hx68 from ram:tmp1.asm TO $(OBJDIR)/$*.obj INCDIR include: OPTIMON 0xfdc00000 ADDSYM \
	DEFINE VBLANK_BUG=1

#CFLAGS= -X36 -X105 -X107 -DEXECSEMAPHORES -DGFX_RASTPORT_1_2 -DNEW_HEDLEY -DV1_3 -DCLIPPING
CFLAGS= -dEXECSEMAPHORES -dGFX_RASTPORT_1_2 -dNEW_HEDLEY -dV1_3 -dCLIPPING -dVBLANK_BUG

SCFLAGS=DEFINE EXECSEMAPHORES=1 DEFINE GFX_RASTPORT_1_2=1 DEFINE NEW_HEDLEY=1 DEFINE V1_3=1 DEFINE CLIPPING=1 DEFINE VBLANK_BUG=1
 
.c.obj:
	lc -r0 -O -iINCLUDE: -me -sc=graphics -sd=graphics -o$(OBJDIR)/$*.obj -qram: -v -b0 $(CFLAGS) $*.c
#	sc $(SCFLAGS) ADDSYMBOLS ABSFUNCPOINTER CODENAME graphics DATANAME graphics IDIR include: LIBCODE MEMSIZE h OBJNAME=$(OBJDIR)/$*.obj OPTIMIZE OPTCOMP 4 OPTDEP 4 OPTSIZE $*.c
AFILES2=update.asm downregions.asm 
AFILES1=minterms.asm romgfxint.asm misc.asm ffill2asm.asm coppermover.asm downellipse.asm interface.asm
AFILES=$(AFILES1) \
	$(AFILES2)

CFILES1=blitplate.c cbump.c copper.c flood.c cpwrup.c
CFILES2=setrast.c colorconvert.c
CFILES3=ffill.c ffill2.c ffillsubrs.c g.c cdraw.c
CFILES4=makevp.c loadview.c 
CFILES5=clipline.c drawvect.c clipdraw.c 
CFILES6=areaend.c 
CFILES7=scrollraster.c sync_sbitmap.c copy_sbitmap.c waitbovp.c
CFILES8=blitplate2.c 
CFILES9=freevportcoplists.c freecprlist.c
CFILESA=scrollvp.c newgenblit.c bltrastport.c
CFILESB=bltbitmask.c clipstuff.c 
CFILESC=memory.c monitor.c vlimit.c setrpattr.c
CFILESD=modeid.c buildvp.c great.c bestid.c coerce.c

OTHERFILES=lmkfile

CFILES=$(CFILES1)\
	$(CFILES2)\
	$(CFILES3)\
	$(CFILES4)\
	$(CFILES5)\
	$(CFILES6)\
	$(CFILES7)\
	$(CFILES8)\
	$(CFILES9)\
	$(CFILESA)\
	$(CFILESB)\
	$(CFILESC)\
	$(CFILESD)

EXTERNIFILES=
IFILES=	areafill.i cdrawinfo.i ffill.i gfxblit.i $(EXTERNIFILES)

EXTERNHFILES=
HFILES=	areafill.h cdrawinfo.h ffill.h gfxblit.h gfxprivate.h gs_info.h tune.h $(EXTERNHFILES)


FIRSTO=
OFILES =  \
	$(OBJDIR)/blitplate.obj $(OBJDIR)/cbump.obj $(OBJDIR)/copper.obj $(OBJDIR)/flood.obj $(OBJDIR)/cpwrup.obj\
	$(OBJDIR)/setrast.obj $(OBJDIR)/colorconvert.obj\
	$(OBJDIR)/ffill.obj $(OBJDIR)/ffill2.obj $(OBJDIR)/ffillsubrs.obj $(OBJDIR)/minterms.obj $(OBJDIR)/g.obj $(OBJDIR)/cdraw.obj\
	$(OBJDIR)/makevp.obj $(OBJDIR)/loadview.obj \
	$(OBJDIR)/clipline.obj $(OBJDIR)/drawvect.obj $(OBJDIR)/clipdraw.obj $(OBJDIR)/romgfxint.obj \
	$(OBJDIR)/areaend.obj \
	$(OBJDIR)/scrollraster.obj $(OBJDIR)/sync_sbitmap.obj $(OBJDIR)/copy_sbitmap.obj $(OBJDIR)/waitbovp.obj\
	$(OBJDIR)/blitplate2.obj\
	$(OBJDIR)/freevportcoplists.obj $(OBJDIR)/freecprlist.obj $(OBJDIR)/clipstuff.obj\
	$(OBJDIR)/scrollvp.obj $(OBJDIR)/misc.obj $(OBJDIR)/newgenblit.obj $(OBJDIR)/bltrastport.obj\
	$(OBJDIR)/bltbitmask.obj $(OBJDIR)/ffill2asm.obj $(OBJDIR)/buildvp.obj \
	$(OBJDIR)/coppermover.obj $(OBJDIR)/downellipse.obj $(OBJDIR)/memory.obj \
	$(OBJDIR)/monitor.obj $(OBJDIR)/vlimit.obj $(OBJDIR)/interface.obj $(OBJDIR)/update.obj \
	$(OBJDIR)/downregions.obj $(OBJDIR)/modeid.obj $(OBJDIR)/setrpattr.obj \
	$(OBJDIR)/great.obj $(OBJDIR)/bestid.obj $(OBJDIR)/coerce.obj

all:	$(SUBSYSNAME).lib

internal:
	copy $(AFILES2) $(DESTDIR) nopro
	copy $(AFILES1) $(DESTDIR) nopro
	copy $(CFILES1) $(DESTDIR) nopro
	copy $(CFILES2) $(DESTDIR) nopro
	copy $(CFILES3) $(DESTDIR) nopro
	copy $(CFILES4) $(DESTDIR) nopro
	copy $(CFILES5) $(DESTDIR) nopro
	copy $(CFILES6) $(DESTDIR) nopro
	copy $(CFILES7) $(DESTDIR) nopro
	copy $(CFILES8) $(DESTDIR) nopro
	copy $(CFILES9) $(DESTDIR) nopro
	copy $(CFILESA) $(DESTDIR) nopro
	copy $(CFILESB) $(DESTDIR) nopro
	copy $(CFILESC) $(DESTDIR) nopro
	copy $(CFILESD) $(DESTDIR) nopro
	copy $(IFILES) $(DESTDIR) nopro
	copy $(HFILES) $(DESTDIR) nopro
	copy $(OTHERFILES) $(DESTDIR) nopro


$(SUBSYSNAME).lib: $(OBJDIR) $(OFILES)
	join $(OBJDIR)/*.obj as $(SUBSYSNAME).lib

$(OBJDIR) :
	makedir $(OBJDIR)
	copy $(OBJSTORE)/*.obj $(OBJDIR) clone quiet
	

saveobjs: $(OBJDIR) $(OFILES)
	copy $(OBJDIR)/*.obj objs clone quiet

clean:
	-delete $(OBJSTORE)/*.obj quiet
	-delete $(OBJDIR) all quiet
	-delete c.lib

protos:
	echo >$(SUBSYSNAME).protos "// this is a comment"
	copy to makep0 from < <
$(CFILES)
<
	splat -o "[\t ]+" "\n" makep0
	splat -o "^..+" "lc -pre -rs $(CFLAGS) -dMAKE_PROTOS -iINCLUDE: -oram: &" makep0
	splat -o "\x0d" "" makep0
	execute makep0
	delete makep0
	join ram:*.i as $(SUBSYSNAME).protos
	echo >>$(SUBSYSNAME).protos "\#include *"romgfxint.i*""
	echo >>$(SUBSYSNAME).protos "\#include *"/a/a.protos*""
	search >ram:a.protos *.asm "__asm" nonum
	search >a1.protos ram:a.protos "__asm" nonum
	splat -o "^;" "" a1.protos
	splat -o "^ " "" a1.protos
	type >>$(SUBSYSNAME).protos a1.protos
	delete a1.protos
	delete ram:*.i

depend:
	copy to maked0 from < <
$(AFILES)
$(CFILES)
<
	splat -o "[\t ]+" "\n" maked0
	splat -o "^..+" "dep1 &" maked0
	echo >ram:maked1 "alias dep1 depend [] makedx"
	join ram:maked1 maked0 as maked1
	splat -o "\x0d" "" maked1
	execute maked1
	splat -o "^" "$(OBJDIR)/&" makedx
	splat -o "^$(OBJDIR)/\n" "\n" makedx
	splat -o ".o " ".obj " makedx
	copy makedx graphics$(VERSION).depend
	delete maked? quiet

doc:
	copy to maked0 from < <
$(AFILES)
$(CFILES)
<
	splat -o "[\t ]+" "\n" maked0
	splat -o "^..+" "type >>$(SUBSYSNAME).doc &" maked0
	splat -o "\x0d" "" maked0
	splat -o "^type >>$(SUBSYSNAME).doc \n" "\n" maked0
	echo >maked1 "if exists $(SUBSYSNAME).doc"
	echo >>maked1 "delete $(SUBSYSNAME).doc quiet"
	echo >>maked1 "endif"
	join maked1 maked0 as ram:x
	execute ram:x
	delete maked? quiet



ram:cobjs/minterms.obj : minterms.asm

ram:cobjs/romgfxint.obj : romgfxint.asm

ram:cobjs/misc.obj : misc.asm	/gfx.i	/gfxbase.i	/cia8520.i	/sane_names.i	/macros.i	/a/submacs.i	/rastport.i	/clip.i

ram:cobjs/ffill2asm.obj : ffill2asm.asm

ram:cobjs/coppermover.obj : coppermover.asm	/copper.i	/gfxbase.i	/monitor.i	/view.i	/display.i	/macros.i

ram:cobjs/downellipse.obj : downellipse.asm	/macros.i	/a/submacs.i

ram:cobjs/interface.obj : interface.asm

ram:cobjs/update.obj : update.asm	/gfx.i	/gfxbase.i	/view.i	/display.i	/monitor.i	/copper.i

ram:cobjs/downregions.obj : downregions.asm

ram:cobjs/blitplate.obj : blitplate.c	/sane_names.h	gfxblit.h	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/cbump.obj : cbump.c	tune.h	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/copper.obj : copper.c	/gfx.h	tune.h	/view.h	/copper.h	/display.h	/gfxbase.h	/monitor.h	/gfxbase.h	/macros.h	gfxprivate.h	romgfxint.i	/a/a.protos	c.protos	/displayinfo_internal.h

ram:cobjs/flood.obj : flood.c	/gfxbase.h	/macros.h	/gfxbase.h	/clip.h	/rastport.h	/sane_names.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/cpwrup.obj : cpwrup.c	/gfxbase.h	/macros.h	/copper.h	/displayinfo.h	/cia8520.h	/d/d.protos	/displayinfo_internal.h	/gfx.h	/view.h	/display.h	/gfxbase.h	gfxprivate.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/setrast.obj : setrast.c	/sane_names.h	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/colorconvert.obj : colorconvert.c	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/ffill.obj : ffill.c	/gfxbase.h	/macros.h	ffill.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/ffill2.obj : ffill2.c	ffill.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/ffillsubrs.obj : ffillsubrs.c	/gfx.h	/gfxbase.h	/macros.h	ffill.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/g.obj : g.c	/gfxbase.h	/macros.h	tune.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/cdraw.obj : cdraw.c	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos	cdrawinfo.h

ram:cobjs/makevp.obj : makevp.c

ram:cobjs/loadview.obj : loadview.c	/gfx.h	/gfxbase.h	/copper.h	/view.h	/display.h	romgfxint.i	/a/a.protos	c.protos	/gfxbase.h	/macros.h

ram:cobjs/clipline.obj : clipline.c	cdrawinfo.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/drawvect.obj : drawvect.c	/sane_names.h	romgfxint.i	/a/a.protos	c.protos	cdrawinfo.h

ram:cobjs/clipdraw.obj : clipdraw.c	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos	cdrawinfo.h

ram:cobjs/areaend.obj : areaend.c	areafill.h	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/scrollraster.obj : scrollraster.c	/gfxbase.h	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos	/gfxpragmas.h

ram:cobjs/sync_sbitmap.obj : sync_sbitmap.c	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/copy_sbitmap.obj : copy_sbitmap.c	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/waitbovp.obj : waitbovp.c	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/blitplate2.obj : blitplate2.c	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/freevportcoplists.obj : freevportcoplists.c	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/freecprlist.obj : freecprlist.c	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/scrollvp.obj : scrollvp.c	/gfx.h	/gfxbase.h	/display.h	/copper.h	/view.h	/vp_internal.h	/displayinfo_internal.h	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/newgenblit.obj : newgenblit.c	/gels/gelsinternal.h	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/bltrastport.obj : bltrastport.c	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos	/gfxbase.h

ram:cobjs/bltbitmask.obj : bltbitmask.c	/gfxpragmas.h	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/clipstuff.obj : clipstuff.c	/displayinfo.h	/gfx.h	/gfxbase.h	/display.h	/copper.h	/view.h	/monitor.h	/gfxbase.h	/macros.h	/vp_internal.h	romgfxint.i	/a/a.protos	c.protos	/d/d.protos

ram:cobjs/memory.obj : memory.c	/monitor.h	/gfxbase.h	/macros.h	/gfxnodes.h	/view.h	/gfxbase.h	gfxprivate.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/monitor.obj : monitor.c	/gfxbase.h	/macros.h	/gfxnodes.h	/view.h	/gfxbase.h	/d/d.protos	/gfxpragmas.h	/displayinfo_internal.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/vlimit.obj : vlimit.c	/gfxbase.h	/macros.h	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/setrpattr.obj : setrpattr.c	/gfxbase.h	/gfxpragmas.h	/gfxbase.h	/macros.h

ram:cobjs/modeid.obj : modeid.c	/d/d.protos	romgfxint.i	/a/a.protos	c.protos

ram:cobjs/buildvp.obj : buildvp.c

ram:cobjs/great.obj : great.c	/gfxbase.h	/macros.h	/displayinfo_internal.h	/displayinfo.h	/gfx.h	/gfxbase.h	/sane_names.h	gfxprivate.h	romgfxint.i	/a/a.protos	c.protos	/d/d.protos

ram:cobjs/bestid.obj : bestid.c /modeid.h /view.h /displayinfo.h /gfx.h /gfxbase.h /displayinfo_internal.h /macros.h /gfxpragmas.h c.protos /d/d.protos

ram:cobjs/coerce.obj : coerce.c /modeid.h /coerce.h /displayinfo.h c.protos /gfxpragmas.h
