Blob Blame History Raw
#######################################################################
#                                                                     #
#                 MLTk, Tcl/Tk interface of OCaml                     #
#                                                                     #
#    Francois Rouaix, Francois Pessaux, Jun Furuse and Pierre Weis    #
#               projet Cristal, INRIA Rocquencourt                    #
#            Jacques Garrigue, Kyoto University RIMS                  #
#                                                                     #
#  Copyright 2002 Institut National de Recherche en Informatique et   #
#  en Automatique and Kyoto University.  All rights reserved.         #
#  This file is distributed under the terms of the GNU Library        #
#  General Public License, with the special exception on linking      #
#  described in file LICENSE found in the OCaml source tree.          #
#                                                                     #
#######################################################################

include ../support/Makefile.common

all: tk.ml # labltk.ml .depend

     # all 3 dependencies are generated by the same rule. When the
     # target 'all' depends on the 3 files, a 'make -jN' will spawn 3
     # shell processes, and generate all files 3 times in parallel...

_tkgen.ml: ../Widgets.src ../compiler/tkcompiler$(EXE)
	cd ..; $(CAMLRUNGEN) compiler/tkcompiler$(EXE) -outdir labltk

# dependencies are broken: wouldn't work with gmake 3.77

#tk.ml labltk.ml .depend: generate

tk.ml labltk.ml .depend: _tkgen.ml ../builtin/report.ml ../compiler/pp$(EXE) #../builtin/builtin_*.ml
	(echo 'open StdLabels'; \
	 echo 'open Widget'; \
	 echo 'open Protocol'; \
	 echo 'open Support'; \
	 echo 'open Textvariable'; \
	 cat ../builtin/report.ml; \
	 cat ../builtin/builtin_*.ml; \
	 cat _tkgen.ml; \
	 echo ; \
	 echo ; \
	 echo 'module Tkintf = struct'; \
	 cat ../builtin/builtini_*.ml; \
	 cat _tkigen.ml; \
	 echo 'end (* module Tkintf *)'; \
	 echo ; \
	 echo ; \
	 echo 'open Tkintf' ;\
	 echo ; \
	 echo ; \
	 cat ../builtin/builtinf_*.ml; \
	 cat _tkfgen.ml; \
	 echo ; \
	) > _tk.ml
	$(CAMLRUN) ../compiler/pp < _tk.ml > tk.ml
	rm -f _tk.ml
	$(CAMLDEP) -slash -I ../support [a-z]*.mli [a-z]*.ml > .depend

../compiler/pp$(EXE):
	cd ../compiler; $(MAKE) pp$(EXE)

../compiler/tkcompiler$(EXE):
	cd ../compiler; $(MAKE) tkcompiler$(EXE)

# All .{ml,mli} files are generated in this directory
clean:
	rm -f *.cm* *.ml *.mli *.$(O) *.$(A) .depend

#	rm -f modules

.PHONY: all generate clean