summaryrefslogtreecommitdiff
path: root/camlp4/Makefile.Mac
blob: 7b96430a1e06959d44382c73e9a07c8963241fff (plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#######################################################################
#                                                                     #
#                             Camlp4                                  #
#                                                                     #
#            Damien Doligez, projet Para, INRIA Rocquencourt          #
#                                                                     #
#  Copyright 1999 Institut National de Recherche en Informatique et   #
#  en Automatique.  Distributed only by permission.                   #
#                                                                     #
#######################################################################

# $Id$

DIRS = odyl camlp4 meta etc top ocpp lib man
FDIRS = odyl camlp4 meta lib

all Ä :boot:camlp4
    for i in {DIRS}
      directory {i}
      domake all
      directory ::
    end

:boot:camlp4 Ä
    domake clean_cold library_cold compile_cold
    domake promote_cold
    domake clean_cold clean_hot library

clean_hot Ä
    for i in {DIRS}
      directory {i}
      domake clean
      directory ::
    end

depend Ä
    for i in {DIRS}
      directory {i}
      domake depend
      directory ::
    end

install Ä
    for i in {DIRS}
      directory {i}
      domake install
      directory ::
    end

scratch Ä clean
    delete -i :boot:Å.cm[oi] || set status 0
    delete -i :boot:camlp4Å || set status 0
    delete -y -i :boot:SAVED

clean Ä clean_hot clean_cold

# Normal bootstrap

bootstrap Ä backup promote clean_hot all compare

backup Ä
    newfolder :boot.new
    domake mv_cvs -d FROM=:boot: -d TO=:boot.new:
    move :boot :boot.new:SAVED
    move :boot.new :boot

restore Ä
    move :boot:SAVED :boot.new
    domake mv_cvs -d FROM=:boot: -d TO=:boot.new:
    delete -y -i :boot
    rename :boot.new :boot

promote Ä
    for i in {FDIRS}
      directory {i}
      domake promote
      directory ::
    end

compare Ä
    set failures 0
    set exit 0
    for i in {FDIRS}
      directory {i}
      domake compare ³ dev:null
      evaluate failures += {status}
      directory ::
    end
    if {failures}
      echo "Fixpoint not reached, try one more bootstrapping cycle."
    else
      echo "Fixpoint reached, bootstrap succeeded."
    end

cleanboot Ä
    delete -i -y :boot:SAVED:SAVED


# Fast bootstrap

bootstrap_fast Ä backup promote clean_hot fast compare

fast Ä :boot:camlp4
    for i in {FDIRS}
      directory {i}
      domake all
      directory ::
    end

clean_fast Ä
    for i in {FDIRS}
      directory {i}
      domake clean
      directory ::
    end


# The very beginning

world Ä
    domake clean_cold library_cold compile_cold
    domake promote_cold
    domake clean_cold clean_hot library all

library Ä
    directory lib
    domake all promote
    directory ::

# Cold start using pure Objective Caml sources

library_cold Ä
    directory :ocaml_src:lib
    domake all promote
    directory :::

compile_cold Ä
    directory ocaml_src
    for i in {FDIRS}
      directory {i}
      domake all
      directory ::
    end
    directory ::

promote_cold Ä
    for i in {FDIRS}
      directory :ocaml_src:{i}
      domake promote
      directory :::
    end

clean_cold Ä
    for i in {FDIRS}
      directory :ocaml_src:{i}
      domake clean
      directory :::
    end

# Bootstrap the sources

#bootstrap_sources Ä
#    cd etc; make pr_o.cmo
#    mkdir ocaml_src.new
#    @-for i in $(FDIRS); do \
#        (mkdir ocaml_src.new/$$i; cd ocaml_src.new/$$i; \
#         sed 's/# $$Id.*\$$/# Id/' ../../$$i/Makefile | \
#         sed 's-include ../config-include ../../config-g' | \
#         sed 's-../boot-../../boot-g' > Makefile; \
#         cp ../../$$i/.depend .) \
#     done
#    @-for i in $(FDIRS); do \
#        for j in $$i/*.ml*; do \
#            echo ============================================; \
#            echo ocaml_src.new/$$j; \
#            ./tools/conv.sh $$j | \
#            sed 's/$$Id.*\$$/Id/' > ocaml_src.new/$$j; \
#        done; \
#    done

#promote_sources:
#    make mv_cvs FROM=ocaml_src TO=ocaml_src.new
#    for i in $(FDIRS); do \
#        make mv_cvs FROM=ocaml_src/$$i TO=ocaml_src.new/$$i; \
#    done
#    mv ocaml_src/tools ocaml_src.new/.
#    mv ocaml_src ocaml_src.new/SAVED
#    mv ocaml_src.new ocaml_src

#unpromote_sources:
#    mv ocaml_src ocaml_src.new
#    mv ocaml_src.new/SAVED ocaml_src
#    mv ocaml_src.new/tools ocaml_src/.
#    for i in $(FDIRS); do \
#        make mv_cvs FROM=ocaml_src.new/$$i TO=ocaml_src/$$i; \
#    done
#    make mv_cvs FROM=ocaml_src.new TO=ocaml_src

#clean_sources:
#    rm -rf ocaml_src/SAVED/SAVED

mv_cvs Ä
    if "`exists "{FROM}CVS"`"; move "{FROM}CVS" "{TO}"; end
    if "`exists "{FROM}.cvsignore"`"; move "{FROM}.cvsignore" "{TO}"; end