-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile.gen
72 lines (60 loc) · 2.52 KB
/
Makefile.gen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#######################################################################
# #
# 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