include Makefile.config

# We are using the non-installed library !
COMPFLAGS= -I +camltk
LINKFLAGS= -I +camltk

# Use pieces of Makefile.config
TKLINKOPT=-ccopt -L../support -cclib -lcamltk \
	  $(TKLIBS) $(X11_LIBS) \
          camltk.cma

all: addition helloworld winskel fileinput eyes tetris mytext

addition: addition.cmo
	$(CAMLC) -custom $(LINKFLAGS) $(TKLINKOPT) \
		-o $@ addition.cmo 

helloworld: helloworld.cmo
	$(CAMLC) -custom $(LINKFLAGS) $(TKLINKOPT) \
		-o $@ helloworld.cmo 

winskel: winskel.cmo
	$(CAMLC) -custom $(LINKFLAGS) $(TKLINKOPT) \
		-o $@ winskel.cmo

fileinput: fileinput.cmo
	$(CAMLC) -custom $(LINKFLAGS) unix.cma $(TKLINKOPT) -cclib -lunix \
		-o $@ fileinput.cmo

socketinput: socketinput.cmo
	$(CAMLC) -custom $(LINKFLAGS) unix.cma $(TKLINKOPT) -cclib -lunix \
		-o $@ socketinput.cmo

eyes: eyes.cmo
	$(CAMLC) -custom $(LINKFLAGS) unix.cma $(TKLINKOPT) \
		-o $@ eyes.cmo

tetris: tetris.cmo
	$(CAMLC) -custom $(LINKFLAGS) unix.cma $(TKLINKOPT) \
		-o $@ tetris.cmo

mytext: mytext.cmo
	$(CAMLC) -custom $(LINKFLAGS) unix.cma $(TKLINKOPT) \
		-o $@ mytext.cmo

clean : 
	rm -f *.cm? addition helloworld winskel fileinput eyes tetris mytext
	-gzip tetris.ml

tetris.ml:
	gunzip tetris.ml.gz

.SUFFIXES :
.SUFFIXES : .mli .ml .cmi .cmo

.mli.cmi:
	$(CAMLCOMP) $(COMPFLAGS) $<

.ml.cmo:
	$(CAMLCOMP) $(COMPFLAGS) $<
