PROGRAM = main
LIBS	= Time.so File.so FileStatus.so FileStream.so \
	  SqueakObject.so \
	  SqueakImage.so \
	  Squeak.so

IDC = idc -k

all : $(LIBS) $(PROGRAM)

Surface.so : Surface.st surface-imp.*
	$(IDC) -J/usr/X11R6/include -s $< -L/usr/X11R6/lib -lX11

SqueakVM-proxy.so : vmProxy.c

SqueakVM-BitBlt.so : SqueakVM-BitBlt.st BitBltPlugin.o
	$(IDC) -s $< BitBltPlugin.o

BitBltPlugin.o : BitBltPlugin.c
	$(CC) -g -c -o $@ $<

%.so : %.st
	$(IDC) -s $<

%.o : %.st
	$(IDC) -c $<

% : %.st
	$(IDC) $<

run : all
	./main temp.image

tidy: .FORCE
	rm -f *~

clean : tidy .FORCE
	rm -f $(PROGRAM) $(PROGRAM).c $(LIBS) *.exe *so.c LOG SqueakDebug.log .gdb*

spotless : clean .FORCE

.FORCE :
