COMMONFLAGS = parm=reg math=ieee verbose \
          utilitylibrary stringmerge gst=t:includes.gst define=__USE_SYSBASE

SCFLAGS = optimize opttime nodebug nostackcheck $(COMMONFLAGS)

#SCFLAGS = nooptimize debug=full $(COMMONFLAGS)

OBJS =	flick.o median.o \
	c2p_8.o c2p_6.o c2p_4.o \
	c2p320x200x8.o \
	c2p320x200x6.o \
	c2p_8_040.o c2p_6_040.o c2p_4_040.o \
	c2p320x200x8_040.o \
	c2p320x200x6_040.o \
	c2p_8_cmp.o c2p_6_cmp.o c2p_4_cmp.o \
	c2p320x200x8_cmp.o \
	c2p320x200x6_cmp.o

flick: $(OBJS)
	slink <with <
from lib:c.o $(OBJS) \
to flick \
lib lib:scmieee.lib lib:sc.lib lib:amiga.lib \
smallcode smalldata \
define __CXM33=__UCXM33 \
define __CXD33=__UCXD33 \
define __CXM22=__UCXM22 \
define __CXD22=__UCXD22
<

flick.o: flick.c t:includes.gst
	sc $(SCFLAGS) flick.c

median.o: median.c t:includes.gst
	sc $(SCFLAGS) median.c

c2p_8.o: adaptive.s smakefile
	macro68 -D "generic,depth=8" adaptive.s -o c2p_8.o

c2p_6.o: adaptive.s smakefile
	macro68 -D "generic,depth=6" adaptive.s -o c2p_6.o

c2p_4.o: adaptive.s smakefile
	macro68 -D "generic,depth=4" adaptive.s -o c2p_4.o

c2p320x200x8.o: adaptive.s smakefile
	macro68 -D "width=320,height=200,depth=8" adaptive.s -o c2p320x200x8.o

c2p320x200x6.o: adaptive.s smakefile
	macro68 -D "width=320,height=200,depth=6" adaptive.s -o c2p320x200x6.o

c2p_8_040.o: chunky8.s smakefile
	macro68 -D "generic,depth=8" chunky8.s -o c2p_8_040.o

c2p_6_040.o: chunky8.s smakefile
	macro68 -D "generic,depth=6" chunky8.s -o c2p_6_040.o

c2p_4_040.o: chunky8.s smakefile
	macro68 -D "generic,depth=4" chunky8.s -o c2p_4_040.o

c2p320x200x8_040.o: chunky8.s smakefile
	macro68 -D "width=320,height=200,depth=8" chunky8.s -o c2p320x200x8_040.o

c2p320x200x6_040.o: chunky8.s smakefile
	macro68 -D "width=320,height=200,depth=6" chunky8.s -o c2p320x200x6_040.o

c2p_8_cmp.o: c2p_cmp.s smakefile
	macro68 -D "generic,depth=8" c2p_cmp.s -o c2p_8_cmp.o

c2p_6_cmp.o: c2p_cmp.s smakefile
	macro68 -D "generic,depth=6" c2p_cmp.s -o c2p_6_cmp.o

c2p_4_cmp.o: c2p_cmp.s smakefile
	macro68 -D "generic,depth=4" c2p_cmp.s -o c2p_4_cmp.o

c2p320x200x8_cmp.o: c2p_cmp.s smakefile
	macro68 -D "width=320,height=200,depth=8" c2p_cmp.s -o c2p320x200x8_cmp.o

c2p320x200x6_cmp.o: c2p_cmp.s smakefile
	macro68 -D "width=320,height=200,depth=6" c2p_cmp.s -o c2p320x200x6_cmp.o

t:includes.gst: includes.h smakefile
	sc $(SCFLAGS) makegst=t:includes.gst includes.h
