include ../Makefile.config

all: hashtblc.cmo support.cmo widget.cmo protocol.cmo \
     textvariable.cmo timer.cmo fileevent.cmo \
     libcamltk41.a

COBJS=cltkCaml.o cltkEval.o cltkEvent.o cltkFile.o cltkMain.o \
      cltkMisc.o cltkTimer.o cltkVar.o cltkWait.o

CCFLAGS=-ccopt -g $(X_CFLAGS) $(TCLTKINCLUDES)

libcamltk41.a : $(COBJS)
	rm -f libcamltk41.a
	ar rc libcamltk41.a $(COBJS)

PUB=fileevent.cmi fileevent.mli \
    protocol.cmi protocol.mli \
    textvariable.cmi textvariable.mli \
    timer.cmi timer.mli \
    widget.cmi widget.mli \
    hashtblc.cmi hashtblc.mli

install: libcamltk41.a $(PUB)
	if test -d $(INSTALLDIR); then : ; else mkdir $(INSTALLDIR); fi
	cp $(PUB) $(INSTALLDIR)
	cp libcamltk41.a $(INSTALLDIR)
	cd $(INSTALLDIR); chmod 644 $(PUB) libcamltk41.a
	$(RANLIB) $(INSTALLDIR)/libcamltk41.a

clean : 
	rm -f *.cm* *.o *.a

.SUFFIXES :
.SUFFIXES : .mli .ml .cmi .cmo .mlp .c .o

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

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

.c.o:
	$(CAMLCOMP) $(CCFLAGS) $<

depend:
	$(CAMLDEP) *.mli *.ml > .depend

include .depend
