
.SUFFIXES:	.o .s

CFLAGS =  -DUNIX -DGWS -DASSEMBLY

LD =		ld

RASTEROP =  screen.o clear.o paint.o invert.o toggle.o copy.o copyp.o setup.o \
	    lsetup.o copyu.o toggleu.o paintu.o dispchk.o

CRASTEROP =  screen.o clear.o paint.o invert.o toggle.o copy.o copyp.o setup.o \
	    lsetup.o copyu.o toggleu.o paintu.o dispchk.o loadlut.o

all:	raster.a craster.a

raster.a:   $(RASTEROP)
	ar cru $@ $(RASTEROP)
	ranlib $@

craster.a:   $(CRASTEROP)
	cd color; ar cru ../$@ $(CRASTEROP)
	ranlib $@

.s.o:
	cp $*.s $*.c
	$(CC) $(CFLAGS) -c -E $*.c > $*.i
	$(AS) $*.i -o $*.o
	$(CC) $(CFLAGS) -DCOLOR -c -E $*.c > $*.i
	$(AS) $*.i -o color/$*.o
	rm -f $*.c $*.i

clean:
	rm -f raster.a craster.a color/* $(CRASTEROP) core

#
#	dependencies
#

clear.o: clear.s ../h/ashelp.h ../h/ucode.h Makefile
paint.o: paint.s ../h/ashelp.h ../h/ucode.h Makefile
invert.o: invert.s ../h/ashelp.h ../h/ucode.h Makefile
toggle.o: toggle.s ../h/ashelp.h ../h/ucode.h Makefile
copy.o: copy.s ../h/ashelp.h ../h/ucode.h Makefile
copyp.o:  copyp.s ../h/ashelp.h ../h/ucode.h Makefile
setup.o: setup.s ../h/ashelp.h ../h/ucode.h Makefile
lsetup.o: lsetup.s ../h/ashelp.h ../h/ucode.h Makefile
copyu.o: copyu.s ../h/ashelp.h ../h/ucode.h Makefile
toggleu.o: toggleu.s ../h/ashelp.h ../h/ucode.h Makefile
paintu.o: paintu.s ../h/ashelp.h ../h/ucode.h Makefile
dispchk.o: dispchk.s ../h/ashelp.h Makefile
screen.o: screen.s Makefile
