Debian Codegraph @

tools/CoqMakefile.in

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 ##########################################################################
2 ## # The Rocq Prover / The Rocq Development Team ##
3 ## v # Copyright INRIA, CNRS and contributors ##
4 ## <O___,, # (see version control and CREDITS file for authors & dates) ##
5 ## \VV/ ###############################################################
6 ## // # This file is distributed under the terms of the ##
7 ## # GNU Lesser General Public License Version 2.1 ##
8 ## # (see LICENSE file for the text of the license) ##
9 ##########################################################################
10 ## GNUMakefile for Rocq @COQ_VERSION@
11
12 # For debugging purposes (must stay here, don't move below)
13 INITIAL_VARS := $(.VARIABLES)
14 # To implement recursion we save the name of the main Makefile
15 SELF := $(lastword $(MAKEFILE_LIST))
16 PARENT := $(firstword $(MAKEFILE_LIST))
17
18 # This file is generated by coq_makefile and contains many variable
19 # definitions, like the list of .v files or the path to Rocq
20 include @CONF_FILE@
21
22 # Put in place old names
23 VFILES := $(COQMF_VFILES)
24 MLIFILES := $(COQMF_MLIFILES)
25 MLFILES := $(COQMF_MLFILES)
26 MLGFILES := $(COQMF_MLGFILES)
27 MLPACKFILES := $(COQMF_MLPACKFILES)
28 MLLIBFILES := $(COQMF_MLLIBFILES)
29 METAFILE := $(COQMF_METAFILE)
30 CMDLINE_VFILES := $(COQMF_CMDLINE_VFILES)
31 INSTALLCOQDOCROOT := $(COQMF_INSTALLCOQDOCROOT)
32 OTHERFLAGS := $(COQMF_OTHERFLAGS)
33 COQCORE_SRC_SUBDIRS := $(COQMF_COQ_SRC_SUBDIRS)
34 OCAMLLIBS := $(COQMF_OCAMLLIBS)
35 SRC_SUBDIRS := $(COQMF_SRC_SUBDIRS)
36 COQLIBS := $(COQMF_COQLIBS)
37 COQLIBS_NOML := $(COQMF_COQLIBS_NOML)
38 CMDLINE_COQLIBS := $(COQMF_CMDLINE_COQLIBS)
39 COQLIB := $(COQMF_COQLIB)
40 COQCORELIB := $(COQMF_COQCORELIB)
41 DOCDIR := $(COQMF_DOCDIR)
42 OCAMLFIND := $(COQMF_OCAMLFIND)
43 CAMLFLAGS := $(COQMF_CAMLFLAGS)
44 HASNATDYNLINK := $(COQMF_HASNATDYNLINK)
45 OCAMLWARN := $(COQMF_WARN)
46
47 @CONF_FILE@: @PROJECT_FILE@
48 @COQ_MAKEFILE_INVOCATION@
49
50 # This file can be created by the user to hook into double colon rules or
51 # add any other Makefile code they may need
52 -include @LOCAL_FILE@
53
54 # Parameters ##################################################################
55 #
56 # Parameters are make variable assignments.
57 # They can be passed to (each call to) make on the command line.
58 # They can also be put in @LOCAL_FILE@ once and for all.
59 # For retro-compatibility reasons they can be put in the _CoqProject, but this
60 # practice is discouraged since _CoqProject better not contain make specific
61 # code (be nice to user interfaces).
62
63 # Set KEEP_ERROR to have make keep files produced by failing rules.
64 # By default, KEEP_ERROR is empty. So for instance if rocq c creates a .vo but
65 # then fails to native compile, the .vo will be deleted.
66 # May confuse make so use only for debugging.
67 KEEP_ERROR?=
68 ifeq (,$(KEEP_ERROR))
69 .DELETE_ON_ERROR:
70 endif
71
72 # Print shell commands (set to non empty)
73 VERBOSE ?=
74
75 # Time the Rocq process (set to non empty), and how (see default value)
76 TIMED?=
77 TIMECMD?=
78 # Use command time on linux, gtime on Mac OS
79 TIMEFMT?="$(if $(findstring undefined, $(flavor 1)),$@,$(1)) (real: %e, user: %U, sys: %S, mem: %M ko)"
80 ifeq (0,$(shell command time -f "" true >/dev/null 2>/dev/null; echo $$?))
81 STDTIME?=command time -f $(TIMEFMT)
82 else
83 ifeq (0,$(shell gtime -f "" true >/dev/null 2>/dev/null; echo $$?))
84 STDTIME?=gtime -f $(TIMEFMT)
85 else
86 STDTIME?=command time
87 endif
88 endif
89
90 COQBIN?=
91 ifneq (,$(COQBIN))
92 # add an ending /
93 COQBIN:=$(COQBIN)/
94 endif
95
96 # Coq binaries
97 ROCQ ?= "$(COQBIN)rocq"
98 COQC ?= "$(COQBIN)rocq" c
99 COQTOP ?= "$(COQBIN)rocq" repl
100 COQCHK ?= "$(COQBIN)rocqchk"
101 COQNATIVE ?= "$(COQBIN)rocq" native-precompile
102 COQDEP ?= "$(COQBIN)rocq" dep
103 COQDOC ?= "$(COQBIN)rocq" doc
104 COQPP ?= "$(COQBIN)rocq" pp-mlg
105 COQMKFILE ?= "$(COQBIN)rocq" makefile
106 OCAMLLIBDEP ?= "$(COQBIN)ocamllibdep"
107
108 # Timing scripts
109 COQMAKE_ONE_TIME_FILE ?= "$(COQCORELIB)/tools/make-one-time-file.py"
110 COQMAKE_BOTH_TIME_FILES ?= "$(COQCORELIB)/tools/make-both-time-files.py"
111 COQMAKE_BOTH_SINGLE_TIMING_FILES ?= "$(COQCORELIB)/tools/make-both-single-timing-files.py"
112 BEFORE ?=
113 AFTER ?=
114
115 # OCaml binaries
116 CAMLC ?= "$(OCAMLFIND)" ocamlc -c
117 CAMLOPTC ?= "$(OCAMLFIND)" opt -c
118 CAMLLINK ?= "$(OCAMLFIND)" ocamlc -linkall
119 CAMLOPTLINK ?= "$(OCAMLFIND)" opt -linkall
120 CAMLDOC ?= "$(OCAMLFIND)" ocamldoc
121 CAMLDEP ?= "$(OCAMLFIND)" ocamldep -slash -ml-synonym .mlpack
122
123 # DESTDIR is prepended to all installation paths
124 DESTDIR ?=
125
126 # Debug builds, typically -g to OCaml, -debug to Rocq.
127 CAMLDEBUG ?=
128 COQDEBUG ?=
129
130 # Extra packages to be linked in (as in findlib -package)
131 CAMLPKGS ?=
132 FINDLIBPKGS = -package rocq-runtime.plugins.ltac $(CAMLPKGS)
133
134 # Option for making timing files
135 TIMING?=
136 # Option for changing sorting of timing output file
137 TIMING_SORT_BY ?= auto
138 # Option for changing the fuzz parameter on the output file
139 TIMING_FUZZ ?= 0
140 # Option for changing whether to use real or user time for timing tables
141 TIMING_REAL?=
142 # Option for including the memory column(s)
143 TIMING_INCLUDE_MEM?=
144 # Option for sorting by the memory column
145 TIMING_SORT_BY_MEM?=
146 # Output file names for timed builds
147 TIME_OF_BUILD_FILE ?= time-of-build.log
148 TIME_OF_BUILD_BEFORE_FILE ?= time-of-build-before.log
149 TIME_OF_BUILD_AFTER_FILE ?= time-of-build-after.log
150 TIME_OF_PRETTY_BUILD_FILE ?= time-of-build-pretty.log
151 TIME_OF_PRETTY_BOTH_BUILD_FILE ?= time-of-build-both.log
152 TIME_OF_PRETTY_BUILD_EXTRA_FILES ?= - # also output to the command line
153
154 TGTS ?=
155
156 # Retro compatibility (DESTDIR is standard on Unix, DSTROOT is not)
157 ifdef DSTROOT
158 DESTDIR := $(DSTROOT)
159 endif
160
161 # Substitution of the path by appending $(DESTDIR) if needed.
162 # The variable $(COQMF_WINDRIVE) can be needed for Cygwin environments.
163 windrive_path = $(if $(COQMF_WINDRIVE),$(subst $(COQMF_WINDRIVE),/,$(1)),$(1))
164 destination_path = $(if $(DESTDIR),$(DESTDIR)/$(call windrive_path,$(1)),$(1))
165
166 # Installation paths of libraries and documentation.
167 COQLIBINSTALL ?= $(call destination_path,$(COQLIB)/user-contrib)
168 COQDOCINSTALL ?= $(call destination_path,$(DOCDIR)/coq/user-contrib)
169 COQPLUGININSTALL ?= $(call destination_path,$(COQCORELIB)/..)
170 COQTOPINSTALL ?= $(call destination_path,$(COQLIB)/toploop) # FIXME: Unused variable?
171
172 # findlib files installation
173 FINDLIBPREINST= mkdir -p "$(COQPLUGININSTALL)/"
174 FINDLIBDESTDIR= -destdir "$(COQPLUGININSTALL)/"
175
176 # we need to move out of sight $(METAFILE) otherwise findlib thinks the
177 # package is already installed
178 findlib_install = \
179 $(HIDE)if [ "$(METAFILE)" ]; then \
180 $(FINDLIBPREINST) && \
181 mv "$(METAFILE)" "$(METAFILE).skip" ; \
182 "$(OCAMLFIND)" install $(2) $(FINDLIBDESTDIR) $(FINDLIBPACKAGE) $(1); \
183 rc=$$?; \
184 mv "$(METAFILE).skip" "$(METAFILE)"; \
185 exit $$rc; \
186 fi
187 findlib_remove = \
188 $(HIDE)if [ ! -z "$(METAFILE)" ]; then\
189 "$(OCAMLFIND)" remove $(FINDLIBDESTDIR) $(FINDLIBPACKAGE); \
190 fi
191
192
193 ########## End of parameters ##################################################
194 # What follows may be relevant to you only if you need to
195 # extend this Makefile. If so, look for 'Extension point' here and
196 # put in @LOCAL_FILE@ double colon rules accordingly.
197 # E.g. to perform some work after the all target completes you can write
198 #
199 # post-all::
200 # echo "All done!"
201 #
202 # in @LOCAL_FILE@
203 #
204 ###############################################################################
205
206
207
208
209 # Flags #######################################################################
210 #
211 # We define a bunch of variables combining the parameters.
212 # To add additional flags to coq, coqchk or coqdoc, set the
213 # {COQ,COQCHK,COQDOC}EXTRAFLAGS variable to whatever you want to add.
214 # To overwrite the default choice and set your own flags entirely, set the
215 # {COQ,COQCHK,COQDOC}FLAGS variable.
216
217 SHOW := $(if $(VERBOSE),@true "",@echo "")
218 HIDE := $(if $(VERBOSE),,@)
219
220 TIMER=$(if $(TIMED), $(STDTIME), $(TIMECMD))
221
222 OPT?=
223
224 # The DYNLIB variable is used by "coqdep -dyndep var" in .v.d
225 ifeq '$(OPT)' '-byte'
226 USEBYTE:=true
227 DYNLIB:=.cma
228 else
229 USEBYTE:=
230 DYNLIB:=.cmxs
231 endif
232
233 # these variables are meant to be overridden if you want to add *extra* flags
234 COQEXTRAFLAGS?=
235 COQCHKEXTRAFLAGS?=
236 COQDOCEXTRAFLAGS?=
237
238 # Find the last argument of the form "-native-compiler FLAG"
239 COQUSERNATIVEFLAG:=$(strip \
240 $(subst -native-compiler-,,\
241 $(lastword \
242 $(filter -native-compiler-%,\
243 $(subst -native-compiler ,-native-compiler-,\
244 $(strip $(COQEXTRAFLAGS)))))))
245
246 COQFILTEREDEXTRAFLAGS:=$(strip \
247 $(filter-out -native-compiler-%,\
248 $(subst -native-compiler ,-native-compiler-,\
249 $(strip $(COQEXTRAFLAGS)))))
250
251 COQACTUALNATIVEFLAG:=$(lastword $(COQMF_COQ_NATIVE_COMPILER_DEFAULT) $(COQMF_COQPROJECTNATIVEFLAG) $(COQUSERNATIVEFLAG))
252
253 ifeq '$(COQACTUALNATIVEFLAG)' 'yes'
254 COQNATIVEFLAG="-w" "-deprecated-native-compiler-option" "-native-compiler" "ondemand"
255 COQDONATIVE="yes"
256 else
257 ifeq '$(COQACTUALNATIVEFLAG)' 'ondemand'
258 COQNATIVEFLAG="-w" "-deprecated-native-compiler-option" "-native-compiler" "ondemand"
259 COQDONATIVE="no"
260 else
261 COQNATIVEFLAG="-w" "-deprecated-native-compiler-option" "-native-compiler" "no"
262 COQDONATIVE="no"
263 endif
264 endif
265
266 # these flags do NOT contain the libraries, to make them easier to overwrite
267 COQFLAGS?=-q $(OTHERFLAGS) $(COQFILTEREDEXTRAFLAGS) $(COQNATIVEFLAG)
268 COQCHKFLAGS?=-silent -o $(COQCHKEXTRAFLAGS)
269 COQDOCFLAGS?=-interpolate -utf8 $(COQDOCEXTRAFLAGS)
270
271 COQDOCLIBS?=$(COQLIBS_NOML)
272
273 # The version of Coq being run and the version of rocq makefile that
274 # generated this makefile
275 COQ_VERSION:=$(shell $(ROCQ) --print-version | cut -d " " -f 1)
276 COQMAKEFILE_VERSION:=@COQ_VERSION@
277
278 # COQ_SRC_SUBDIRS is for user-overriding, usually to add
279 # `user-contrib/Foo` to the includes, we keep COQCORE_SRC_SUBDIRS for
280 # Coq's own core libraries, which should be replaced by ocamlfind
281 # options at some point.
282 COQ_SRC_SUBDIRS?=
283 COQSRCLIBS?= $(foreach d,$(COQ_SRC_SUBDIRS), -I "$(COQLIB)/$(d)")
284
285 CAMLFLAGS+=$(OCAMLLIBS) $(COQSRCLIBS)
286 # ocamldoc fails with unknown argument otherwise
287 CAMLDOCFLAGS:=$(filter-out -annot, $(filter-out -bin-annot, $(CAMLFLAGS)))
288 CAMLFLAGS+=$(OCAMLWARN)
289
290 ifneq (,$(TIMING))
291 ifeq (after,$(TIMING))
292 TIMING_EXT=after-timing
293 else
294 ifeq (before,$(TIMING))
295 TIMING_EXT=before-timing
296 else
297 TIMING_EXT=timing
298 endif
299 endif
300 TIMING_ARG=-time-file $<.$(TIMING_EXT)
301 else
302 TIMING_ARG=
303 endif
304
305 ifneq (,$(PROFILING))
306 PROFILE_ARG=-profile [email protected]
307 PROFILE_ZIP=gzip -f [email protected]
308 else
309 PROFILE_ARG=
310 PROFILE_ZIP=true
311 endif
312
313 # Files #######################################################################
314 #
315 # We here define a bunch of variables about the files being part of the
316 # Rocq project in order to ease the writing of build target and build rules
317
318 VDFILE := @DEP_FILE@
319
320 ALLSRCFILES := \
321 $(MLGFILES) \
322 $(MLFILES) \
323 $(MLPACKFILES) \
324 $(MLLIBFILES) \
325 $(MLIFILES)
326
327 # helpers
328 vo_to_obj = $(addsuffix .o,\
329 $(filter-out Warning: Error:,\
330 $(shell $(COQTOP) -q -noinit -batch -quiet -print-mod-uid $(1))))
331 strip_dotslash = $(patsubst ./%,%,$(1))
332
333 # without this we get undefined variables in the expansion for the
334 # targets of the [deprecated,use-mllib-or-mlpack] rule
335 with_undef = $(if $(filter-out undefined, $(origin $(1))),$($(1)))
336
337 VO = vo
338 VOS = vos
339
340 VOFILES = $(VFILES:.v=.$(VO))
341 GLOBFILES = $(VFILES:.v=.glob)
342 HTMLFILES = $(VFILES:.v=.html)
343 GHTMLFILES = $(VFILES:.v=.g.html)
344 BEAUTYFILES = $(addsuffix .beautified,$(VFILES))
345 TEXFILES = $(VFILES:.v=.tex)
346 GTEXFILES = $(VFILES:.v=.g.tex)
347 CMOFILES = \
348 $(MLGFILES:.mlg=.cmo) \
349 $(MLFILES:.ml=.cmo) \
350 $(MLPACKFILES:.mlpack=.cmo)
351 CMXFILES = $(CMOFILES:.cmo=.cmx)
352 OFILES = $(CMXFILES:.cmx=.o)
353 CMAFILES = $(MLLIBFILES:.mllib=.cma) $(MLPACKFILES:.mlpack=.cma)
354 CMXAFILES = $(CMAFILES:.cma=.cmxa)
355 CMIFILES = \
356 $(CMOFILES:.cmo=.cmi) \
357 $(MLIFILES:.mli=.cmi)
358 # the /if/ is because old _CoqProject did not list a .ml(pack|lib) but just
359 # a .mlg file
360 CMXSFILES = \
361 $(MLPACKFILES:.mlpack=.cmxs) \
362 $(CMXAFILES:.cmxa=.cmxs) \
363 $(if $(MLPACKFILES)$(CMXAFILES),,\
364 $(MLGFILES:.mlg=.cmxs) $(MLFILES:.ml=.cmxs))
365
366 # files that are packed into a plugin (no extension)
367 PACKEDFILES = \
368 $(call strip_dotslash, \
369 $(foreach lib, \
370 $(call strip_dotslash, \
371 $(MLPACKFILES:.mlpack=_MLPACK_DEPENDENCIES)),$(call with_undef,$(lib))))
372 # files that are archived into a .cma (mllib)
373 LIBEDFILES = \
374 $(call strip_dotslash, \
375 $(foreach lib, \
376 $(call strip_dotslash, \
377 $(MLLIBFILES:.mllib=_MLLIB_DEPENDENCIES)),$(call with_undef,$(lib))))
378 CMIFILESTOINSTALL = $(filter-out $(addsuffix .cmi,$(PACKEDFILES)),$(CMIFILES))
379 CMOFILESTOINSTALL = $(filter-out $(addsuffix .cmo,$(PACKEDFILES)),$(CMOFILES))
380 OBJFILES = $(call vo_to_obj,$(VOFILES))
381 ALLNATIVEFILES = \
382 $(OBJFILES:.o=.cmi) \
383 $(OBJFILES:.o=.cmx) \
384 $(OBJFILES:.o=.cmxs)
385 FINDLIBPACKAGE=$(patsubst .%,%,$(suffix $(METAFILE)))
386
387 # trick: wildcard filters out non-existing files, so that `install` doesn't show
388 # warnings and `clean` doesn't pass to rm a list of files that is too long for
389 # the shell.
390 NATIVEFILES = $(wildcard $(ALLNATIVEFILES))
391 FILESTOINSTALL = \
392 $(VOFILES) \
393 $(VFILES) \
394 $(GLOBFILES) \
395 $(NATIVEFILES)
396 FINDLIBFILESTOINSTALL = \
397 $(CMIFILESTOINSTALL)
398 ifeq '$(HASNATDYNLINK)' 'true'
399 DO_NATDYNLINK = yes
400 FINDLIBFILESTOINSTALL += $(CMXSFILES) $(CMXAFILES) $(CMOFILESTOINSTALL:.cmo=.cmx)
401 else
402 DO_NATDYNLINK =
403 endif
404
405 ALLDFILES = $(addsuffix .d,$(ALLSRCFILES)) $(VDFILE)
406
407 # Compilation targets #########################################################
408
409 all:
410 $(HIDE)$(MAKE) --no-print-directory -f "$(SELF)" pre-all
411 $(HIDE)$(MAKE) --no-print-directory -f "$(SELF)" real-all
412 $(HIDE)$(MAKE) --no-print-directory -f "$(SELF)" post-all
413 .PHONY: all
414
415 all.timing.diff:
416 $(HIDE)$(MAKE) --no-print-directory -f "$(SELF)" pre-all
417 $(HIDE)$(MAKE) --no-print-directory -f "$(SELF)" real-all.timing.diff TIME_OF_PRETTY_BUILD_EXTRA_FILES=""
418 $(HIDE)$(MAKE) --no-print-directory -f "$(SELF)" post-all
419 .PHONY: all.timing.diff
420
421 ifeq (0,$(TIMING_REAL))
422 TIMING_REAL_ARG :=
423 TIMING_USER_ARG := --user
424 else
425 ifeq (1,$(TIMING_REAL))
426 TIMING_REAL_ARG := --real
427 TIMING_USER_ARG :=
428 else
429 TIMING_REAL_ARG :=
430 TIMING_USER_ARG :=
431 endif
432 endif
433
434 ifeq (0,$(TIMING_INCLUDE_MEM))
435 TIMING_INCLUDE_MEM_ARG := --no-include-mem
436 else
437 TIMING_INCLUDE_MEM_ARG :=
438 endif
439
440 ifeq (1,$(TIMING_SORT_BY_MEM))
441 TIMING_SORT_BY_MEM_ARG := --sort-by-mem
442 else
443 TIMING_SORT_BY_MEM_ARG :=
444 endif
445
446 make-pretty-timed-before:: TIME_OF_BUILD_FILE=$(TIME_OF_BUILD_BEFORE_FILE)
447 make-pretty-timed-after:: TIME_OF_BUILD_FILE=$(TIME_OF_BUILD_AFTER_FILE)
448 make-pretty-timed make-pretty-timed-before make-pretty-timed-after::
449 $(HIDE)rm -f pretty-timed-success.ok
450 $(HIDE)($(MAKE) --no-print-directory -f "$(PARENT)" $(TGTS) TIMED=1 2>&1 && touch pretty-timed-success.ok) | tee -a $(TIME_OF_BUILD_FILE)
451 $(HIDE)rm pretty-timed-success.ok # must not be -f; must fail if the touch failed
452 print-pretty-timed::
453 $(HIDE)$(COQMAKE_ONE_TIME_FILE) $(TIMING_INCLUDE_MEM_ARG) $(TIMING_SORT_BY_MEM_ARG) $(TIMING_REAL_ARG) $(TIME_OF_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_EXTRA_FILES)
454 print-pretty-timed-diff::
455 $(HIDE)$(COQMAKE_BOTH_TIME_FILES) --sort-by=$(TIMING_SORT_BY) $(TIMING_INCLUDE_MEM_ARG) $(TIMING_SORT_BY_MEM_ARG) $(TIMING_REAL_ARG) $(TIME_OF_BUILD_AFTER_FILE) $(TIME_OF_BUILD_BEFORE_FILE) $(TIME_OF_PRETTY_BOTH_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_EXTRA_FILES)
456 ifeq (,$(BEFORE))
457 print-pretty-single-time-diff::
458 @echo 'Error: Usage: $(MAKE) print-pretty-single-time-diff AFTER=path/to/file.v.after-timing BEFORE=path/to/file.v.before-timing'
459 $(HIDE)false
460 else
461 ifeq (,$(AFTER))
462 print-pretty-single-time-diff::
463 @echo 'Error: Usage: $(MAKE) print-pretty-single-time-diff AFTER=path/to/file.v.after-timing BEFORE=path/to/file.v.before-timing'
464 $(HIDE)false
465 else
466 print-pretty-single-time-diff::
467 $(HIDE)$(COQMAKE_BOTH_SINGLE_TIMING_FILES) --fuzz=$(TIMING_FUZZ) --sort-by=$(TIMING_SORT_BY) $(TIMING_USER_ARG) $(AFTER) $(BEFORE) $(TIME_OF_PRETTY_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_EXTRA_FILES)
468 endif
469 endif
470 pretty-timed:
471 $(HIDE)$(MAKE) --no-print-directory -f "$(PARENT)" make-pretty-timed
472 $(HIDE)$(MAKE) --no-print-directory -f "$(SELF)" print-pretty-timed
473 .PHONY: pretty-timed make-pretty-timed make-pretty-timed-before make-pretty-timed-after print-pretty-timed print-pretty-timed-diff print-pretty-single-time-diff
474
475 # Extension points for actions to be performed before/after the all target
476 pre-all::
477 @# Extension point
478 $(HIDE)if [ "$(COQMAKEFILE_VERSION)" != "$(COQ_VERSION)" ]; then\
479 echo "W: This Makefile was generated by Rocq/Coq $(COQMAKEFILE_VERSION)";\
480 echo "W: while the current Rocq version is $(COQ_VERSION)";\
481 fi
482 .PHONY: pre-all
483
484 post-all::
485 @# Extension point
486 .PHONY: post-all
487
488 real-all: $(VOFILES) $(if $(USEBYTE),bytefiles,optfiles)
489 .PHONY: real-all
490
491 real-all.timing.diff: $(VOFILES:.vo=.v.timing.diff)
492 .PHONY: real-all.timing.diff
493
494 bytefiles: $(CMOFILES) $(CMAFILES)
495 .PHONY: bytefiles
496
497 optfiles: $(if $(DO_NATDYNLINK),$(CMXSFILES))
498 .PHONY: optfiles
499
500 vos: $(VOFILES:%.vo=%.vos)
501 .PHONY: vos
502
503 vok: $(VOFILES:%.vo=%.vok)
504 .PHONY: vok
505
506 validate: $(VOFILES)
507 $(TIMER) $(COQCHK) $(COQCHKFLAGS) $(COQLIBS_NOML) $(PROFILE_ARG) $^
508 $(HIDE)$(PROFILE_ZIP)
509 .PHONY: validate
510
511 only: $(TGTS)
512 .PHONY: only
513
514 # Documentation targets #######################################################
515
516 html: $(GLOBFILES) $(VFILES)
517 $(SHOW)'COQDOC -d html $(GAL)'
518 $(HIDE)mkdir -p html
519 $(HIDE)$(COQDOC) \
520 -toc $(COQDOCFLAGS) -html $(GAL) $(COQDOCLIBS) -d html $(VFILES)
521
522 mlihtml: $(MLIFILES:.mli=.cmi)
523 $(SHOW)'CAMLDOC -d $@'
524 $(HIDE)mkdir $@ || rm -rf $@/*
525 $(HIDE)$(CAMLDOC) -html \
526 -d $@ -m A $(CAMLDEBUG) $(CAMLDOCFLAGS) $(MLIFILES) $(FINDLIBPKGS)
527
528 all-mli.tex: $(MLIFILES:.mli=.cmi)
529 $(SHOW)'CAMLDOC -latex $@'
530 $(HIDE)$(CAMLDOC) -latex \
531 -o $@ -m A $(CAMLDEBUG) $(CAMLDOCFLAGS) $(MLIFILES) $(FINDLIBPKGS)
532
533 all.ps: $(VFILES)
534 $(SHOW)'COQDOC -ps $(GAL)'
535 $(HIDE)$(COQDOC) \
536 -toc $(COQDOCFLAGS) -ps $(GAL) $(COQDOCLIBS) \
537 -o $@ `$(COQDEP) -sort $(VFILES)`
538
539 all.pdf: $(VFILES)
540 $(SHOW)'COQDOC -pdf $(GAL)'
541 $(HIDE)$(COQDOC) \
542 -toc $(COQDOCFLAGS) -pdf $(GAL) $(COQDOCLIBS) \
543 -o $@ `$(COQDEP) -sort $(VFILES)`
544
545 # FIXME: not quite right, since the output name is different
546 gallinahtml: GAL=-g
547 gallinahtml: html
548
549 all-gal.ps: GAL=-g
550 all-gal.ps: all.ps
551
552 all-gal.pdf: GAL=-g
553 all-gal.pdf: all.pdf
554
555 # ?
556 beautify: $(BEAUTYFILES)
557 for file in $^; do mv $${file%.beautified} $${file%beautified}old && mv $${file} $${file%.beautified}; done
558 @echo 'Do not do "make clean" until you are sure that everything went well!'
559 @echo 'If there were a problem, execute "for file in $$(find . -name \*.v.old -print); do mv $${file} $${file%.old}; done" in your shell/'
560 .PHONY: beautify
561
562 # Installation targets ########################################################
563 #
564 # There rules can be extended in @LOCAL_FILE@
565 # Extensions can't assume when they run.
566
567 # We use $(file) to avoid generating a very long command string to pass to the shell
568 # (cf https://coq.zulipchat.com/#narrow/stream/250632-Coq-Platform-devs-.26-users/topic/Strange.20command.20length.20limit.20on.20Linux)
569 # However Apple ships old make which doesn't have $(file) so we need a fallback
570 $(file >.hasfile,1)
571 HASFILE:=$(shell if [ -e .hasfile ]; then echo 1; rm .hasfile; fi)
572
573 MKFILESTOINSTALL= $(if $(HASFILE),$(file >.filestoinstall,$(FILESTOINSTALL)),\
574 $(shell rm -f .filestoinstall) \
575 $(foreach x,$(FILESTOINSTALL),$(shell printf '%s\n' "$x" >> .filestoinstall)))
576
577 # findlib needs the package to not be installed, so we remove it before
578 # installing it (see the call to findlib_remove)
579 install: META
580 @$(MKFILESTOINSTALL)
581 $(HIDE)code=0; for f in $$(cat .filestoinstall); do\
582 if ! [ -f "$$f" ]; then >&2 echo $$f does not exist; code=1; fi \
583 done; exit $$code
584 $(HIDE)for f in $$(cat .filestoinstall); do\
585 df="`$(COQMKFILE) -destination-of "$$f" $(COQLIBS)`";\
586 if [ "$$?" != "0" -o -z "$$df" ]; then\
587 echo SKIP "$$f" since it has no logical path;\
588 else\
589 install -d "$(COQLIBINSTALL)/$$df" &&\
590 install -m 0644 "$$f" "$(COQLIBINSTALL)/$$df" &&\
591 echo INSTALL "$$f" "$(COQLIBINSTALL)/$$df";\
592 fi;\
593 done
594 $(call findlib_remove)
595 $(call findlib_install, META $(FINDLIBFILESTOINSTALL))
596 $(HIDE)$(MAKE) install-extra -f "$(SELF)"
597 @rm -f .filestoinstall
598 install-extra::
599 @# Extension point
600 .PHONY: install install-extra
601
602 META: $(METAFILE)
603 $(HIDE)if [ "$(METAFILE)" ]; then \
604 cat "$(METAFILE)" | grep -v 'directory.*=.*' > META; \
605 fi
606
607 install-byte:
608 $(call findlib_install, $(CMAFILES) $(CMOFILESTOINSTALL), -add)
609
610 install-doc:: html mlihtml
611 @# Extension point
612 $(HIDE)install -d "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/html"
613 $(HIDE)for i in html/*; do \
614 dest="$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/$$i";\
615 install -m 0644 "$$i" "$$dest";\
616 echo INSTALL "$$i" "$$dest";\
617 done
618 $(HIDE)install -d \
619 "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/mlihtml"
620 $(HIDE)for i in mlihtml/*; do \
621 dest="$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/$$i";\
622 install -m 0644 "$$i" "$$dest";\
623 echo INSTALL "$$i" "$$dest";\
624 done
625 .PHONY: install-doc
626
627 uninstall::
628 @# Extension point
629 @$(MKFILESTOINSTALL)
630 $(call findlib_remove)
631 $(HIDE)for f in $$(cat .filestoinstall); do \
632 df="`$(COQMKFILE) -destination-of "$$f" $(COQLIBS)`" &&\
633 instf="$(COQLIBINSTALL)/$$df/`basename $$f`" &&\
634 rm -f "$$instf" &&\
635 echo RM "$$instf" ;\
636 done
637 $(HIDE)for f in $$(cat .filestoinstall); do \
638 df="`$(COQMKFILE) -destination-of "$$f" $(COQLIBS)`" &&\
639 echo RMDIR "$(COQLIBINSTALL)/$$df/" &&\
640 (rmdir "$(COQLIBINSTALL)/$$df/" 2>/dev/null || true); \
641 done
642 @rm -f .filestoinstall
643
644 .PHONY: uninstall
645
646 uninstall-doc::
647 @# Extension point
648 $(SHOW)'RM $(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/html'
649 $(HIDE)rm -rf "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/html"
650 $(SHOW)'RM $(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/mlihtml'
651 $(HIDE)rm -rf "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/mlihtml"
652 $(HIDE) rmdir "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/" || true
653 .PHONY: uninstall-doc
654
655 # Cleaning ####################################################################
656 #
657 # There rules can be extended in @LOCAL_FILE@
658 # Extensions can't assume when they run.
659
660 clean::
661 @# Extension point
662 $(SHOW)'CLEAN'
663 $(HIDE)rm -f $(CMOFILES)
664 $(HIDE)rm -f $(CMIFILES)
665 $(HIDE)rm -f $(CMAFILES)
666 $(HIDE)rm -f $(CMXFILES)
667 $(HIDE)rm -f $(CMXAFILES)
668 $(HIDE)rm -f $(CMXSFILES)
669 $(HIDE)rm -f $(OFILES)
670 $(HIDE)rm -f $(CMXAFILES:.cmxa=.a)
671 $(HIDE)rm -f $(MLGFILES:.mlg=.ml)
672 $(HIDE)rm -f $(CMXFILES:.cmx=.cmt)
673 $(HIDE)rm -f $(MLIFILES:.mli=.cmti)
674 $(HIDE)rm -f $(ALLDFILES)
675 $(HIDE)rm -f $(NATIVEFILES)
676 $(HIDE)find . -name .coq-native -type d -empty -delete
677 $(HIDE)rm -f $(VOFILES)
678 $(HIDE)rm -f $(VOFILES:.vo=.vos)
679 $(HIDE)rm -f $(VOFILES:.vo=.vok)
680 $(HIDE)rm -f $(VOFILES:.vo=.vo.prof.json)
681 $(HIDE)rm -f $(VOFILES:.vo=.vo.prof.json.gz)
682 $(HIDE)rm -f $(BEAUTYFILES) $(VFILES:=.old)
683 $(HIDE)rm -f all.ps all-gal.ps all.pdf all-gal.pdf all.glob all-mli.tex
684 $(HIDE)rm -f $(VFILES:.v=.glob)
685 $(HIDE)rm -f $(VFILES:.v=.tex)
686 $(HIDE)rm -f $(VFILES:.v=.g.tex)
687 $(HIDE)rm -f pretty-timed-success.ok
688 $(HIDE)rm -f META
689 $(HIDE)rm -rf html mlihtml
690 .PHONY: clean
691
692 cleanall:: clean
693 @# Extension point
694 $(SHOW)'CLEAN *.aux *.timing'
695 $(HIDE)rm -f $(foreach f,$(VFILES:.v=),$(dir $(f)).$(notdir $(f)).aux)
696 $(HIDE)rm -f $(TIME_OF_BUILD_FILE) $(TIME_OF_BUILD_BEFORE_FILE) $(TIME_OF_BUILD_AFTER_FILE) $(TIME_OF_PRETTY_BUILD_FILE) $(TIME_OF_PRETTY_BOTH_BUILD_FILE)
697 $(HIDE)rm -f $(VOFILES:.vo=.v.timing)
698 $(HIDE)rm -f $(VOFILES:.vo=.v.before-timing)
699 $(HIDE)rm -f $(VOFILES:.vo=.v.after-timing)
700 $(HIDE)rm -f $(VOFILES:.vo=.v.timing.diff)
701 $(HIDE)rm -f .lia.cache .nia.cache
702 .PHONY: cleanall
703
704 archclean::
705 @# Extension point
706 $(SHOW)'CLEAN *.cmx *.o'
707 $(HIDE)rm -f $(NATIVEFILES)
708 $(HIDE)rm -f $(CMOFILES:%.cmo=%.cmx)
709 .PHONY: archclean
710
711
712 # Compilation rules ###########################################################
713
714 $(MLIFILES:.mli=.cmi): %.cmi: %.mli
715 $(SHOW)'CAMLC -c $<'
716 $(HIDE)$(TIMER) $(CAMLC) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) $<
717
718 $(MLGFILES:.mlg=.ml): %.ml: %.mlg
719 $(SHOW)'COQPP $<'
720 $(HIDE)$(COQPP) $<
721
722 # Stupid hack around a deficient syntax: we cannot concatenate two expansions
723 $(filter %.cmo, $(MLFILES:.ml=.cmo) $(MLGFILES:.mlg=.cmo)): %.cmo: %.ml
724 $(SHOW)'CAMLC -c $<'
725 $(HIDE)$(TIMER) $(CAMLC) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) $<
726
727 # Same hack
728 $(filter %.cmx, $(MLFILES:.ml=.cmx) $(MLGFILES:.mlg=.cmx)): %.cmx: %.ml
729 $(SHOW)'CAMLOPT -c $(FOR_PACK) $<'
730 $(HIDE)$(TIMER) $(CAMLOPTC) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) $(FOR_PACK) $<
731
732
733 $(MLLIBFILES:.mllib=.cmxs): %.cmxs: %.cmxa
734 $(SHOW)'CAMLOPT -shared -o $@'
735 $(HIDE)$(TIMER) $(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) \
736 -shared -o $@ $<
737
738 $(MLLIBFILES:.mllib=.cma): %.cma: | %.mllib
739 $(SHOW)'CAMLC -a -o $@'
740 $(HIDE)$(TIMER) $(CAMLLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) -a -o $@ $^
741
742 $(MLLIBFILES:.mllib=.cmxa): %.cmxa: | %.mllib
743 $(SHOW)'CAMLOPT -a -o $@'
744 $(HIDE)$(TIMER) $(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) -a -o $@ $^
745
746
747 $(MLPACKFILES:.mlpack=.cmxs): %.cmxs: %.cmxa
748 $(SHOW)'CAMLOPT -shared -o $@'
749 $(HIDE)$(TIMER) $(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) \
750 -shared -o $@ $<
751
752 $(MLPACKFILES:.mlpack=.cmxa): %.cmxa: %.cmx | %.mlpack
753 $(SHOW)'CAMLOPT -a -o $@'
754 $(HIDE)$(TIMER) $(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) -a -o $@ $<
755
756 $(MLPACKFILES:.mlpack=.cma): %.cma: %.cmo | %.mlpack
757 $(SHOW)'CAMLC -a -o $@'
758 $(HIDE)$(TIMER) $(CAMLLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) -a -o $@ $^
759
760 $(MLPACKFILES:.mlpack=.cmo): %.cmo: | %.mlpack
761 $(SHOW)'CAMLC -pack -o $@'
762 $(HIDE)$(TIMER) $(CAMLLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) -pack -o $@ $^
763
764 $(MLPACKFILES:.mlpack=.cmx): %.cmx: | %.mlpack
765 $(SHOW)'CAMLOPT -pack -o $@'
766 $(HIDE)$(TIMER) $(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) -pack -o $@ $^
767
768 # This rule is for _CoqProject with no .mllib nor .mlpack
769 $(filter-out $(MLLIBFILES:.mllib=.cmxs) $(MLPACKFILES:.mlpack=.cmxs) $(addsuffix .cmxs,$(PACKEDFILES)) $(addsuffix .cmxs,$(LIBEDFILES)),$(MLFILES:.ml=.cmxs) $(MLGFILES:.mlg=.cmxs)): %.cmxs: %.cmx
770 $(SHOW)'[deprecated,use-mllib-or-mlpack] CAMLOPT -shared -o $@'
771 $(HIDE)$(TIMER) $(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(FINDLIBPKGS) \
772 -shared -o $@ $<
773
774 # can't make
775 # https://www.gnu.org/software/make/manual/make.html#Static-Pattern
776 # work with multiple target rules
777 # so use eval in a loop instead
778 # with grouped targets https://www.gnu.org/software/make/manual/make.html#Multiple-Targets
779 # if available (GNU Make >= 4.3)
780 ifneq (,$(filter grouped-target,$(.FEATURES)))
781 define globvorule=
782
783 # take care to $$ variables using $< etc
784 $(1).vo $(1).glob &: $(1).v | $$(VDFILE)
785 $$(SHOW)ROCQ compile $(1).v
786 $$(HIDE)$$(TIMER) $$(ROCQ) compile $$(COQDEBUG) $$(TIMING_ARG) $$(PROFILE_ARG) $$(COQFLAGS) $$(COQLIBS) $(1).v
787 $$(HIDE)rm -f $(1).vos $(1).vok && touch $(1).vos $(1).vok # make empty vos and vok files
788 $$(HIDE)$$(PROFILE_ZIP)
789 ifeq ($(COQDONATIVE), "yes")
790 $$(SHOW)COQNATIVE $(1).vo
791 $$(HIDE)$$(call TIMER,$(1).vo.native) $$(COQNATIVE) $$(COQLIBS) $(1).vo
792 endif
793
794 endef
795 else
796
797 $(VOFILES): %.vo: %.v | $(VDFILE)
798 $(SHOW)ROCQ compile $<
799 $(HIDE)$(TIMER) $(ROCQ) compile $(COQDEBUG) $(TIMING_ARG) $(PROFILE_ARG) $(COQFLAGS) $(COQLIBS) $<
800 $(HIDE)rm -f $@s $@k && touch $@s $@k # make empty vos and vok files
801 $(HIDE)$(PROFILE_ZIP)
802 ifeq ($(COQDONATIVE), "yes")
803 $(SHOW)COQNATIVE $@
804 $(HIDE)$(call TIMER,[email protected]) $(COQNATIVE) $(COQLIBS) $@
805 endif
806
807 # this is broken :( todo fix if we ever find a solution that doesn't need grouped targets
808 $(GLOBFILES): %.glob: %.v
809 $(SHOW)'ROCQ compile $< (for .glob)'
810 $(HIDE)$(TIMER) $(ROCQ) compile $(COQDEBUG) $(COQFLAGS) $(COQLIBS) $<
811
812 endif
813
814 $(foreach vfile,$(VFILES:.v=),$(eval $(call globvorule,$(vfile))))
815
816 $(VFILES:.v=.vos): %.vos: %.v
817 $(SHOW)ROCQ compile -vos $<
818 $(HIDE)$(TIMER) $(ROCQ) compile -vos $(COQDEBUG) $(COQFLAGS) $(COQLIBS) $<
819
820 $(VFILES:.v=.vok): %.vok: %.v
821 $(SHOW)ROCQ compile -vok $<
822 $(HIDE)rm -f $@ && touch $@ # make empty vok file
823 $(HIDE)$(TIMER) $(ROCQ) compile -vok $(COQDEBUG) $(COQFLAGS) $(COQLIBS) $<
824
825 $(addsuffix .timing.diff,$(VFILES)): %.timing.diff : %.before-timing %.after-timing
826 $(SHOW)PYTHON TIMING-DIFF $*.{before,after}-timing
827 $(HIDE)$(MAKE) --no-print-directory -f "$(SELF)" print-pretty-single-time-diff BEFORE=$*.before-timing AFTER=$*.after-timing TIME_OF_PRETTY_BUILD_FILE="$@"
828
829 $(BEAUTYFILES): %.v.beautified: %.v
830 $(SHOW)'BEAUTIFY $<'
831 $(HIDE)$(TIMER) $(ROCQ) compile $(COQDEBUG) $(COQFLAGS) $(COQLIBS) -beautify $<
832
833 $(TEXFILES): %.tex: %.v
834 $(SHOW)'COQDOC -latex $<'
835 $(HIDE)$(COQDOC) $(COQDOCFLAGS) -latex $< -o $@
836
837 $(GTEXFILES): %.g.tex: %.v
838 $(SHOW)'COQDOC -latex -g $<'
839 $(HIDE)$(COQDOC) $(COQDOCFLAGS) -latex -g $< -o $@
840
841 $(HTMLFILES): %.html: %.v %.glob
842 $(SHOW)'COQDOC -html $<'
843 $(HIDE)$(COQDOC) $(COQDOCFLAGS) -html $< -o $@
844
845 $(GHTMLFILES): %.g.html: %.v %.glob
846 $(SHOW)'COQDOC -html -g $<'
847 $(HIDE)$(COQDOC) $(COQDOCFLAGS) -html -g $< -o $@
848
849 # Dependency files ############################################################
850
851 ifndef MAKECMDGOALS
852 -include $(ALLDFILES)
853 else
854 ifneq ($(filter-out archclean clean cleanall printenv make-pretty-timed make-pretty-timed-before make-pretty-timed-after print-pretty-timed print-pretty-timed-diff print-pretty-single-time-diff,$(MAKECMDGOALS)),)
855 -include $(ALLDFILES)
856 endif
857 endif
858
859 .SECONDARY: $(ALLDFILES)
860
861 redir_if_ok = > "$@" || ( RV=$$?; rm -f "$@"; exit $$RV )
862
863 GENMLFILES:=$(MLGFILES:.mlg=.ml)
864 $(addsuffix .d,$(ALLSRCFILES)): $(GENMLFILES)
865
866 $(addsuffix .d,$(MLIFILES)): %.mli.d: %.mli
867 $(SHOW)'CAMLDEP $<'
868 $(HIDE)$(CAMLDEP) $(OCAMLLIBS) "$<" $(redir_if_ok)
869
870 $(addsuffix .d,$(MLGFILES)): %.mlg.d: %.ml
871 $(SHOW)'CAMLDEP $<'
872 $(HIDE)$(CAMLDEP) $(OCAMLLIBS) "$<" $(redir_if_ok)
873
874 $(addsuffix .d,$(MLFILES)): %.ml.d: %.ml
875 $(SHOW)'CAMLDEP $<'
876 $(HIDE)$(CAMLDEP) $(OCAMLLIBS) "$<" $(redir_if_ok)
877
878 $(addsuffix .d,$(MLLIBFILES)): %.mllib.d: %.mllib
879 $(SHOW)'OCAMLLIBDEP $<'
880 $(HIDE)$(OCAMLLIBDEP) -c $(OCAMLLIBS) "$<" $(redir_if_ok)
881
882 $(addsuffix .d,$(MLPACKFILES)): %.mlpack.d: %.mlpack
883 $(SHOW)'OCAMLLIBDEP $<'
884 $(HIDE)$(OCAMLLIBDEP) -c $(OCAMLLIBS) "$<" $(redir_if_ok)
885
886 # If this makefile is created using a _CoqProject we have coqdep get
887 # options from it. This avoids argument length limits for pathological
888 # projects. Note that extra options might be on the command line.
889 VDFILE_FLAGS:=$(if @PROJECT_FILE@,-f @PROJECT_FILE@,) $(CMDLINE_COQLIBS) $(CMDLINE_VFILES)
890
891 $(VDFILE): @PROJECT_FILE@ $(VFILES)
892 $(SHOW)'ROCQ DEP VFILES'
893 $(HIDE)$(TIMER) $(COQDEP) -vos -dyndep var $(VDFILE_FLAGS) $(redir_if_ok)
894
895 # Misc ########################################################################
896
897 byte:
898 $(HIDE)$(MAKE) all "OPT:=-byte" -f "$(SELF)"
899 .PHONY: byte
900
901 opt:
902 $(HIDE)$(MAKE) all "OPT:=-opt" -f "$(SELF)"
903 .PHONY: opt
904
905 # This is deprecated. To extend this makefile use
906 # extension points and @LOCAL_FILE@
907 printenv::
908 $(warning printenv is deprecated)
909 $(warning write extensions in @LOCAL_FILE@ or include @CONF_FILE@)
910 @echo 'COQLIB = $(COQLIB)'
911 @echo 'COQCORELIB = $(COQCORELIB)'
912 @echo 'DOCDIR = $(DOCDIR)'
913 @echo 'OCAMLFIND = $(OCAMLFIND)'
914 @echo 'HASNATDYNLINK = $(HASNATDYNLINK)'
915 @echo 'SRC_SUBDIRS = $(SRC_SUBDIRS)'
916 @echo 'COQ_SRC_SUBDIRS = $(COQ_SRC_SUBDIRS)'
917 @echo 'COQCORE_SRC_SUBDIRS = $(COQCORE_SRC_SUBDIRS)'
918 @echo 'OCAMLFIND = $(OCAMLFIND)'
919 @echo 'PP = $(PP)'
920 @echo 'COQFLAGS = $(COQFLAGS)'
921 @echo 'COQLIB = $(COQLIBS)'
922 @echo 'COQLIBINSTALL = $(COQLIBINSTALL)'
923 @echo 'COQDOCINSTALL = $(COQDOCINSTALL)'
924 .PHONY: printenv
925
926 # Generate a .merlin file. If you need to append directives to this
927 # file you can extend the merlin-hook target in @LOCAL_FILE@
928 .merlin:
929 $(SHOW)'FILL .merlin'
930 $(HIDE)echo 'FLG $(COQMF_CAMLFLAGS)' > .merlin
931 $(HIDE)echo 'B $(COQCORELIB)' >> .merlin
932 $(HIDE)echo 'S $(COQCORELIB)' >> .merlin
933 $(HIDE)$(foreach d,$(COQCORE_SRC_SUBDIRS), \
934 echo 'B $(COQCORELIB)$(d)' >> .merlin;)
935 $(HIDE)$(foreach d,$(COQ_SRC_SUBDIRS), \
936 echo 'S $(COQLIB)$(d)' >> .merlin;)
937 $(HIDE)$(foreach d,$(SRC_SUBDIRS), echo 'B $(d)' >> .merlin;)
938 $(HIDE)$(foreach d,$(SRC_SUBDIRS), echo 'S $(d)' >> .merlin;)
939 $(HIDE)$(MAKE) merlin-hook -f "$(SELF)"
940 .PHONY: merlin
941
942 merlin-hook::
943 @# Extension point
944 .PHONY: merlin-hook
945
946 # prints all variables
947 debug:
948 $(foreach v,\
949 $(sort $(filter-out $(INITIAL_VARS) INITIAL_VARS,\
950 $(.VARIABLES))),\
951 $(info $(v) = $($(v))))
952 .PHONY: debug
953
954 .DEFAULT_GOAL := all
955
956 # Users can create @LOCAL_LATE_FILE@ to hook into double-colon rules
957 # or add other needed Makefile code, using defined
958 # variables if necessary.
959 -include @LOCAL_LATE_FILE@
960
961 # Local Variables:
962 # mode: makefile-gmake
963 # End: