@@ -61,12 +61,14 @@ endif
61
61
62
62
OCAMLC=ocamlc$(DOTOPT) $(COMPFLAGS)
63
63
OCAMLOPT=ocamlopt$(DOTOPT) $(COMPFLAGS)
64
+ OCAMLDEP=ocamldep$(DOTOPT) -slash $(INCLUDES)
64
65
65
66
# Compilers used for Camlp4-preprocessed code. Note that we cannot
66
67
# use the .opt compilers (because ocamlfind doesn't support them).
67
68
68
69
OCAMLC_P4=ocamlfind ocamlc $(COMPFLAGS) $(BITSTRING)
69
70
OCAMLOPT_P4=ocamlfind ocamlopt $(COMPFLAGS) $(BITSTRING)
71
+ OCAMLDEP_P4=ocamlfind ocamldep $(INCLUDES) $(BITSTRING)
70
72
71
73
MENHIR=menhir --explain
72
74
OCAMLLEX=ocamllex -q
@@ -154,7 +156,6 @@ checklink/%.cmx: checklink/%.ml
154
156
clean:
155
157
rm -f $(EXECUTABLES)
156
158
rm -f $(GENERATED)
157
- rm -f tools/recdepend
158
159
for d in $(ALLDIRS); do rm -f $$d/*.cm[iox] $$d/*.o; done
159
160
160
161
cleansource:
@@ -163,16 +164,13 @@ cleansource:
163
164
164
165
# Generation of .depend.extr
165
166
166
- tools/recdepend: tools/recdepend.ml
167
- ocamlopt -o tools/recdepend unix.cmxa tools/recdepend.ml
168
-
169
- RECDEPEND=tools/recdepend
170
-
171
167
depend: $(GENERATED) tools/recdepend
172
168
@echo "Analyzing OCaml dependencies"
173
- @$(RECDEPEND) $(DIRS) -o .depend.extr
174
- ifneq ($(strip $(DIRS_P4)),)
169
+ $(OCAMLDEP) $(foreach d,$(DIRS),$(wildcard $(d)/*.mli $(d)/*.ml)) >.depend.extr
170
+ $(OCAMLDEP) $(GENERATED) >> .depend.extr
171
+ ifneq ($(strip $(DIRS_P4)),)
175
172
@$(RECDEPEND) -use-ocamlfind $(BITSTRING) $(INCLUDES) $(DIRS_P4) >> .depend.extr
173
+ $(OCAMLDEP_P4) $(foreach d,$(DIRS_P4),$(wildcard $(d)/*.mli $(d)/*.ml)) >>.depend.extr
176
174
endif
177
175
178
176
0 commit comments