Makefile.in 63.5 KB
Newer Older
Andrei Paskevich's avatar
Andrei Paskevich committed
1 2 3
####################################################################
#                                                                  #
#  The Why3 Verification Platform   /   The Why3 Development Team  #
4
#  Copyright 2010-2015   --   INRIA - CNRS - Paris-Sud University  #
Andrei Paskevich's avatar
Andrei Paskevich committed
5 6 7 8 9 10
#                                                                  #
#  This software is distributed under the terms of the GNU Lesser  #
#  General Public License version 2.1, with the special exception  #
#  on linking described in file LICENSE.                           #
#                                                                  #
####################################################################
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
11

12 13 14 15 16 17
VERBOSEMAKE ?= @enable_verbose_make@

ifeq ($(VERBOSEMAKE),yes)
  QUIET =
else
  QUIET = yes
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
18 19
endif

20
# install the binaries
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
21
DESTDIR =
22

23
prefix	    = @prefix@
24 25 26 27 28
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@

BINDIR  = $(DESTDIR)@bindir@
LIBDIR  = $(DESTDIR)@libdir@
29
DATADIR = $(DESTDIR)@datarootdir@
30
MANDIR  = $(DESTDIR)@mandir@
31
TOOLDIR = $(LIBDIR)/why3/commands
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
32

Andrei Paskevich's avatar
Andrei Paskevich committed
33
# OS specific stuff
34
EXE   = @EXE@
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
35 36

# other variables
37
CC        = @CC@
38 39 40 41 42 43 44
OCAMLC    = @OCAMLC@
OCAMLOPT  = @OCAMLOPT@
OCAMLDEP  = @OCAMLDEP@
OCAMLLEX  = @OCAMLLEX@
OCAMLYACC = @OCAMLYACC@
OCAMLDOC  = @OCAMLDOC@
OCAMLLIB  = @OCAMLLIB@
45
OCAMLINSTALLLIB  = $(DESTDIR)@OCAMLINSTALLLIB@
46 47
OCAMLBEST = @OCAMLBEST@
OCAMLVERSION = @OCAMLVERSION@
48 49
COQC      = @COQC@
COQDEP    = @COQDEP@
50 51
COQCAMLP  = @COQCAMLP@
COQCAMLPLIB = @COQCAMLPLIB@
MARCHE Claude's avatar
MARCHE Claude committed
52
FRAMAC_LIBDIR = $(DESTDIR)@FRAMAC_LIBDIR@
53

54 55 56 57 58 59
ifeq (@enable_menhirLib@,yes)
MENHIR	  = @MENHIR@ --table
else
MENHIR	  = @MENHIR@
endif

60
DEPFLAGS  = -slash -I lib/why3
61
ifeq (@OCAMLBEST@,opt)
Andrei Paskevich's avatar
Andrei Paskevich committed
62
DEPFLAGS += -native
63 64
endif

65
RUBBER = @RUBBER@
66
HEVEA = @HEVEA@
67
HACHA = @HACHA@
68
EMACS = @EMACS@
69

70
#PSVIEWER  = @PSVIEWER@
Andrei Paskevich's avatar
Andrei Paskevich committed
71
#PDFVIEWER = @PDFVIEWER@
72

73
INCLUDES = @ZIPINCLUDE@ @MENHIRINCLUDE@
74 75 76
WARNINGS = Aer-41-44-45@5
OFLAGS = -w $(WARNINGS) -dtypes -g -I lib/why3 $(INCLUDES)
BFLAGS = -w $(WARNINGS) -dtypes -g -I lib/why3 $(INCLUDES)
77 78 79

OLINKFLAGS = -linkall $(EXTCMXA)
BLINKFLAGS = -linkall $(EXTCMA)
80

81
ifeq (@enable_profiling@,yes)
82 83 84
OFLAGS += -g -p
endif

85 86 87 88 89
ifeq (@enable_bin_annot@,yes)
OFLAGS += -bin-annot
BFLAGS += -bin-annot
endif

90 91
# external libraries common to all binaries

92
EXTOBJS = @MENHIRLIB@
93
EXTLIBS = str unix nums dynlink @ZIPLIB@
94 95 96

EXTCMA	= $(addsuffix .cma,$(EXTLIBS)) $(addsuffix .cmo,$(EXTOBJS))
EXTCMXA = $(addsuffix .cmxa,$(EXTLIBS)) $(addsuffix .cmx,$(EXTOBJS))
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
97

Andrei Paskevich's avatar
Andrei Paskevich committed
98
INSTALLED_LIB_EXTS = a cma cmx cmi cmxa cmxs
99
COMPILED_LIB_EXTS = $(INSTALLED_LIB_EXTS) o cmo cmt cmti annot dep conflicts
Andrei Paskevich's avatar
Andrei Paskevich committed
100

101 102
TARGET_EMACS = share/emacs/why3.elc

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
103 104 105
###############
# main target
###############
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
106

107 108 109 110
all: @OCAMLBEST@
plugins: plugins.@OCAMLBEST@
opt: plugins.opt
byte: plugins.byte
Francois Bobot's avatar
Francois Bobot committed
111

112 113 114 115 116
ifeq (@enable_local@,yes)
all: install_local
endif

.PHONY: byte opt clean depend all install install_local install_no_local
117
.PHONY: plugins plugins.byte plugins.opt
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
118

Andrei Paskevich's avatar
Andrei Paskevich committed
119 120 121 122
CLEANDIRS =
CLEANLIBS =
GENERATED =

123 124 125
##############
# Why3 library
##############
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
126

127
LIBGENERATED = src/util/config.ml \
128
	       src/util/rc.ml src/util/lexlib.ml src/parser/lexer.ml \
129 130
	       src/parser/parser.mli src/parser/parser.ml \
	       src/driver/driver_parser.mli src/driver/driver_parser.ml \
131
	       src/driver/driver_lexer.ml \
132 133
               src/driver/parse_smtv2_model_parser.mli src/driver/parse_smtv2_model_parser.ml \
               src/driver/parse_smtv2_model_lexer.ml \
134
	       src/session/compress.ml src/session/xml.ml \
135
	       src/session/strategy_parser.ml \
136
	       lib/ocaml/why3__BigInt_compat.ml
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
137

138 139
LIB_UTIL = config bigInt util opt lists strings \
	   extmap extset exthtbl weakhtbl \
140
	   hashcons stdlib exn_printer pp json debug loc lexlib print_tree \
141
	   cmdline warning sysutil rc plugin bigInt number pqueue
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
142

143
LIB_CORE = ident ty term pattern decl theory \
144
	   task pretty dterm env trans printer model_parser
145

146
LIB_DRIVER = call_provers driver_ast driver_parser driver_lexer driver \
147
	     whyconf autodetection \
148
             parse_smtv2_model_parser parse_smtv2_model_lexer parse_smtv2_model
149

150
LIB_MLW = ity expr dexpr pdecl pmodule
151

152 153
LIB_PARSER = ptree glob parser typing lexer

154
LIB_TRANSFORM = simplify_formula inlining split_goal induction \
155
		detect_polymorphism \
156
		reduction_engine compute \
157
		eliminate_definition eliminate_algebraic \
158
		eliminate_inductive eliminate_let eliminate_if \
159 160 161 162
		libencoding discriminate encoding encoding_select \
		encoding_guards_full encoding_tags_full \
		encoding_guards encoding_tags encoding_twin \
		encoding_sort simplify_array filter_trigger \
163
		introduction abstraction close_epsilon lift_epsilon \
164
		eliminate_epsilon intro_projections_counterexmp \
165
		intro_vc_vars_counterexmp prepare_for_counterexmp \
MARCHE Claude's avatar
MARCHE Claude committed
166
		eval_match instantiate_predicate smoke_detector \
167
		induction_pr prop_curry
168

169
LIB_PRINTER = alt_ergo why3printer smtv1 smtv2 coq pvs isabelle \
170
	      simplify gappa cvc3 yices mathematica
171

172
LIB_WHYML = mlw_ty mlw_expr mlw_decl mlw_pretty mlw_wp mlw_module \
173
	    mlw_dexpr mlw_typing mlw_driver mlw_exec mlw_ocaml \
174
	    mlw_main mlw_interp
175

176 177 178
LIB_SESSION = compress xml termcode session session_tools strategy \
              strategy_parser session_scheduler

179
LIBMODULES =  $(addprefix src/util/, $(LIB_UTIL)) \
180 181
	      $(addprefix src/core/, $(LIB_CORE)) \
	      $(addprefix src/driver/, $(LIB_DRIVER)) \
182
	      $(addprefix src/mlw/, $(LIB_MLW)) \
183
	      $(addprefix src/parser/, $(LIB_PARSER)) \
184
	      $(addprefix src/transform/, $(LIB_TRANSFORM)) \
François Bobot's avatar
François Bobot committed
185
	      $(addprefix src/printer/, $(LIB_PRINTER)) \
186 187
	      $(addprefix src/whyml/, $(LIB_WHYML)) \
	      $(addprefix src/session/, $(LIB_SESSION))
188

189
LIBDIRS = util core driver mlw parser transform printer whyml session
190
LIBINCLUDES = $(addprefix -I src/, $(LIBDIRS))
MARCHE Claude's avatar
MARCHE Claude committed
191

Andrei Paskevich's avatar
Andrei Paskevich committed
192
LIBDEP = $(addsuffix .dep, $(LIBMODULES))
193 194
LIBCMO = $(addsuffix .cmo, $(LIBMODULES))
LIBCMX = $(addsuffix .cmx, $(LIBMODULES))
195

Andrei Paskevich's avatar
Andrei Paskevich committed
196
$(LIBDEP): DEPFLAGS += $(LIBINCLUDES)
197
$(LIBCMO) $(LIBCMX): INCLUDES += $(LIBINCLUDES)
198
$(LIBCMX): OFLAGS += -for-pack Why3
199

200 201
$(LIBDEP): $(LIBGENERATED)

202 203 204
# Zarith

ifeq (@enable_zarith@,yes)
205
lib/ocaml/why3__BigInt_compat.ml: config.status lib/ocaml/why3__BigInt_zarith.ml
206
	cp lib/ocaml/why3__BigInt_zarith.ml $@
207
else
208
lib/ocaml/why3__BigInt_compat.ml: config.status lib/ocaml/why3__BigInt_num.ml
209
	cp lib/ocaml/why3__BigInt_num.ml $@
210 211
endif

212 213 214 215 216 217 218 219 220 221
# Ocamlzip

ifeq (@enable_zip@,yes)
src/session/compress.ml: config.status src/session/compress_z.ml
	cp src/session/compress_z.ml $@
else
src/session/compress.ml: config.status src/session/compress_none.ml
	cp src/session/compress_none.ml $@
endif

222 223 224 225 226
# hide deprecated warnings for strings

src/util/strings.cmo:: WARNINGS:=$(WARNINGS)-3
src/util/strings.cmx:: WARNINGS:=$(WARNINGS)-3

227
# build targets
228

229 230
byte: lib/why3/why3.cma
opt:  lib/why3/why3.cmxa
231

232
lib/why3/why3.cma: lib/why3/why3.cmo
Andrei Paskevich's avatar
Andrei Paskevich committed
233 234
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) -a $(BFLAGS) -o $@ $^
235

236
lib/why3/why3.cmxa: lib/why3/why3.cmx
Andrei Paskevich's avatar
Andrei Paskevich committed
237 238
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) -a $(OFLAGS) -o $@ $^
239

240
lib/why3/why3.cmo: $(LIBCMO)
Andrei Paskevich's avatar
Andrei Paskevich committed
241 242
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -pack -o $@ $^
243

244
lib/why3/why3.cmx: $(LIBCMX)
Andrei Paskevich's avatar
Andrei Paskevich committed
245 246
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -pack -o $@ $^
247

Andrei Paskevich's avatar
Andrei Paskevich committed
248
# clean and depend
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
249

250
ifneq "$(MAKECMDGOALS:clean%=clean)" "clean"
251
include $(LIBDEP)
Andrei Paskevich's avatar
Andrei Paskevich committed
252
endif
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
253

254
depend: $(LIBDEP)
255

Andrei Paskevich's avatar
Andrei Paskevich committed
256 257 258
CLEANDIRS += src $(addprefix src/, $(LIBDIRS))
CLEANLIBS += lib/why3/why3session lib/why3/why3
GENERATED += $(LIBGENERATED)
259

260 261 262
###############
# installation
###############
263

Jacques-Pascal Deplaix's avatar
Jacques-Pascal Deplaix committed
264 265
clean_old_install::
	rm -rf $(LIBDIR)/why3
MARCHE Claude's avatar
MARCHE Claude committed
266
	rm -rf $(DATADIR)/why3
267
	rm -rf $(OCAMLINSTALLLIB)/why3
MARCHE Claude's avatar
MARCHE Claude committed
268

269

270
ifeq ($(EMACS),no)
271
install_no_local:: clean_old_install
272 273 274
else
install_no_local:: clean_old_install $(TARGET_EMACS)
endif
275
	mkdir -p $(BINDIR)
Jacques-Pascal Deplaix's avatar
Jacques-Pascal Deplaix committed
276
	mkdir -p $(LIBDIR)/why3
277
	mkdir -p $(TOOLDIR)
278
	mkdir -p $(DATADIR)/why3
279
	mkdir -p $(DATADIR)/why3/images
280 281
	mkdir -p $(DATADIR)/why3/images/boomy
	mkdir -p $(DATADIR)/why3/images/fatcow
282
	mkdir -p $(DATADIR)/why3/vim
283
	mkdir -p $(DATADIR)/why3/lang
MARCHE Claude's avatar
MARCHE Claude committed
284
	mkdir -p $(DATADIR)/why3/theories
285
	mkdir -p $(DATADIR)/why3/modules/mach
MARCHE Claude's avatar
MARCHE Claude committed
286
	mkdir -p $(DATADIR)/why3/drivers
287
	mkdir -p $(DATADIR)/emacs/site-lisp/
MARCHE Claude's avatar
MARCHE Claude committed
288
	cp -f theories/*.why $(DATADIR)/why3/theories
289
	cp -f modules/*.mlw $(DATADIR)/why3/modules
290
	cp -f modules/mach/*.mlw $(DATADIR)/why3/modules/mach
Andrei Paskevich's avatar
Andrei Paskevich committed
291
	cp -f drivers/*.drv drivers/*.gen $(DATADIR)/why3/drivers
MARCHE Claude's avatar
MARCHE Claude committed
292
	cp -f LICENSE $(DATADIR)/why3/
293
	cp -f share/provers-detection-data.conf $(DATADIR)/why3/
294
	cp -f share/images/icons.rc $(DATADIR)/why3/images
295
	cp -f share/images/*.png $(DATADIR)/why3/images
MARCHE Claude's avatar
MARCHE Claude committed
296 297
	cp -f share/images/boomy/* $(DATADIR)/why3/images/boomy
	cp -f share/images/fatcow/* $(DATADIR)/why3/images/fatcow
298
	cp -f share/why3session.dtd $(DATADIR)/why3
299
	cp -f share/Makefile.config $(DATADIR)/why3
300
	cp -rf share/javascript $(DATADIR)/why3/javascript
301 302
	cp -f share/vim/why3.vim $(DATADIR)/why3/vim/why3.vim
	cp -f share/lang/why3.lang $(DATADIR)/why3/lang/why3.lang
303

MARCHE Claude's avatar
MARCHE Claude committed
304
install_no_local_lib::
305
	mkdir -p $(OCAMLINSTALLLIB)/why3
306
	cp -f $(wildcard $(addprefix lib/why3/why3., $(INSTALLED_LIB_EXTS))) \
307
		lib/why3/META $(OCAMLINSTALLLIB)/why3
MARCHE Claude's avatar
MARCHE Claude committed
308

309 310
ifeq (@enable_local@,yes)
install install-lib:
311 312
	@echo "Why3 is configured in local installation mode."
	@echo "To install Why3, run ./configure --disable-local ; make ; make install"
313
else
MARCHE Claude's avatar
MARCHE Claude committed
314
install: clean_old_install install_no_local
MARCHE Claude's avatar
MARCHE Claude committed
315
install-lib: install_no_local_lib
316 317
endif

MARCHE Claude's avatar
MARCHE Claude committed
318 319
install-all: install install-lib

Jacques-Pascal Deplaix's avatar
Jacques-Pascal Deplaix committed
320 321 322 323 324 325
##################
# Uninstallation
##################

uninstall: clean_old_install

326 327 328 329 330 331 332
##################
# Why3 emacs mode
##################

%.elc: %.el
	$(EMACS) --batch --no-init-file -f batch-byte-compile $<

Jacques-Pascal Deplaix's avatar
Jacques-Pascal Deplaix committed
333 334 335 336 337 338 339 340 341 342 343 344 345
clean_old_install::
	rm -f $(DATADIR)/emacs/site-lisp/why3.el
ifneq ($(EMACS),no)
	rm -f $(DATADIR)/emacs/site-lisp/why3.elc
endif

install_no_local::
	cp -f share/emacs/why3.el $(DATADIR)/emacs/site-lisp/why3.el
ifneq ($(EMACS),no)
	cp -f share/emacs/why3.elc $(DATADIR)/emacs/site-lisp/why3.elc
endif


346
##################
347
# Why3 plugins
348 349
##################

Andrei Paskevich's avatar
Andrei Paskevich committed
350
PLUGGENERATED = plugins/tptp/tptp_lexer.ml \
351 352
		plugins/tptp/tptp_parser.ml plugins/tptp/tptp_parser.mli \
		plugins/parser/dimacs.ml \
353

354
PLUG_PARSER = genequlin dimacs
355
PLUG_PRINTER =
356
PLUG_TRANSFORM =
357
PLUG_TPTP = tptp_ast tptp_parser tptp_typing tptp_lexer tptp_printer
358

359
PLUGINS = genequlin dimacs tptp
360

Andrei Paskevich's avatar
Andrei Paskevich committed
361
TPTPMODULES = $(addprefix plugins/tptp/, $(PLUG_TPTP))
Andrei Paskevich's avatar
Andrei Paskevich committed
362

Andrei Paskevich's avatar
Andrei Paskevich committed
363 364
TPTPCMO = $(addsuffix .cmo, $(TPTPMODULES))
TPTPCMX = $(addsuffix .cmx, $(TPTPMODULES))
365

366 367 368 369 370 371 372 373 374 375
ifeq (@enable_hypothesis_selection@,yes)
PLUG_TRANSFORM += hypothesis_selection
PLUGINS += hypothesis_selection

lib/plugins/hypothesis_selection.cmxs: INCLUDES += -I @OCAMLGRAPHLIB@
lib/plugins/hypothesis_selection.cmo:  INCLUDES += -I @OCAMLGRAPHLIB@
lib/plugins/hypothesis_selection.cmxs: OFLAGS += graph.cmxa
lib/plugins/hypothesis_selection.cmo:  BFLAGS += graph.cmo
endif

376 377
PLUGMODULES = $(addprefix plugins/parser/, $(PLUG_PARSER)) \
	      $(addprefix plugins/printer/, $(PLUG_PRINTER)) \
Andrei Paskevich's avatar
Andrei Paskevich committed
378
	      $(addprefix plugins/transform/, $(PLUG_TRANSFORM)) \
Andrei Paskevich's avatar
Andrei Paskevich committed
379
	      $(TPTPMODULES)
380

Andrei Paskevich's avatar
Andrei Paskevich committed
381
PLUGDEP = $(addsuffix .dep, $(PLUGMODULES))
382 383 384
PLUGCMO = $(addsuffix .cmo, $(PLUGMODULES))
PLUGCMX = $(addsuffix .cmx, $(PLUGMODULES))

Andrei Paskevich's avatar
Andrei Paskevich committed
385
PLUGDIRS = parser printer transform tptp
386 387
PLUGINCLUDES = $(addprefix -I plugins/, $(PLUGDIRS))

Andrei Paskevich's avatar
Andrei Paskevich committed
388
$(PLUGDEP): DEPFLAGS += $(PLUGINCLUDES)
389 390
$(PLUGCMO) $(PLUGCMX): INCLUDES += $(PLUGINCLUDES)

391 392
$(PLUGDEP): $(PLUGGENERATED)

393 394 395 396 397
LIBPLUGCMO =  $(addsuffix .cmo,  $(addprefix lib/plugins/, $(PLUGINS)))
LIBPLUGCMXS = $(addsuffix .cmxs, $(addprefix lib/plugins/, $(PLUGINS)))

plugins.byte: $(LIBPLUGCMO)
plugins.opt : $(LIBPLUGCMXS)
398 399

lib/plugins/%.cmxs: plugins/parser/%.cmx
Andrei Paskevich's avatar
Andrei Paskevich committed
400
	$(if $(QUIET),@echo 'Linking  $@' &&) \
401 402 403 404 405 406 407
	    $(OCAMLOPT) $(OFLAGS) -shared -o $@ $<

lib/plugins/%.cmo: plugins/parser/%.cmo
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -pack -o $@ $<

lib/plugins/%.cmxs: plugins/printer/%.cmx
Andrei Paskevich's avatar
Andrei Paskevich committed
408
	$(if $(QUIET),@echo 'Linking  $@' &&) \
409 410 411 412 413 414 415
	    $(OCAMLOPT) $(OFLAGS) -shared -o $@ $<

lib/plugins/%.cmo: plugins/printer/%.cmo
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -pack -o $@ $<

lib/plugins/%.cmxs: plugins/transform/%.cmx
Andrei Paskevich's avatar
Andrei Paskevich committed
416
	$(if $(QUIET),@echo 'Linking  $@' &&) \
417 418 419 420 421 422
	    $(OCAMLOPT) $(OFLAGS) -shared -o $@ $<

lib/plugins/%.cmo: plugins/transform/%.cmo
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -pack -o $@ $<

Andrei Paskevich's avatar
Andrei Paskevich committed
423
lib/plugins/tptp.cmxs: $(TPTPCMX)
Andrei Paskevich's avatar
Andrei Paskevich committed
424
	$(if $(QUIET),@echo 'Linking  $@' &&) \
Andrei Paskevich's avatar
Andrei Paskevich committed
425
	    $(OCAMLOPT) $(OFLAGS) -shared -o $@ $^
426

Andrei Paskevich's avatar
Andrei Paskevich committed
427
lib/plugins/tptp.cmo: $(TPTPCMO)
Andrei Paskevich's avatar
Andrei Paskevich committed
428
	$(if $(QUIET),@echo 'Linking  $@' &&) \
Andrei Paskevich's avatar
Andrei Paskevich committed
429
	    $(OCAMLC) $(BFLAGS) -pack -o $@ $^
430

Andrei Paskevich's avatar
Andrei Paskevich committed
431 432
# depend and clean targets

433
ifneq "$(MAKECMDGOALS:clean%=clean)" "clean"
Andrei Paskevich's avatar
Andrei Paskevich committed
434 435 436
include $(PLUGDEP)
endif

437
depend: $(PLUGDEP)
Andrei Paskevich's avatar
Andrei Paskevich committed
438

Andrei Paskevich's avatar
Andrei Paskevich committed
439 440
CLEANDIRS += plugins $(addprefix plugins/, $(PLUGDIRS)) lib/plugins
GENERATED += $(PLUGGENERATED)
441 442 443

install_no_local::
	mkdir -p $(LIBDIR)/why3/plugins
444
	cp -f $(wildcard $(LIBPLUGCMO) $(LIBPLUGCMXS)) $(LIBDIR)/why3/plugins
445

446 447 448 449
###############
# Why3 commands
###############

Andrei Paskevich's avatar
Andrei Paskevich committed
450 451 452 453 454
TOOLSGENERATED = src/tools/why3wc.ml

TOOLS_BIN = why3config why3execute why3extract why3prove \
	    why3realize why3replay why3wc

Andrei Paskevich's avatar
Andrei Paskevich committed
455
TOOLS_FILES = main $(TOOLS_BIN)
456 457 458 459 460 461 462 463 464 465

TOOLSMODULES = $(addprefix src/tools/, $(TOOLS_FILES))

TOOLSDEP = $(addsuffix .dep, $(TOOLSMODULES))
TOOLSCMO = $(addsuffix .cmo, $(TOOLSMODULES))
TOOLSCMX = $(addsuffix .cmx, $(TOOLSMODULES))

$(TOOLSDEP): DEPFLAGS += -I src/tools
$(TOOLSCMO) $(TOOLSCMX): INCLUDES += -I src/tools

Andrei Paskevich's avatar
Andrei Paskevich committed
466 467
$(TOOLSDEP): $(TOOLSGENERATED)

468 469 470
byte: bin/why3.byte $(TOOLS_BIN:%=bin/%.byte)
opt:  bin/why3.opt  $(TOOLS_BIN:%=bin/%.opt)

Andrei Paskevich's avatar
Andrei Paskevich committed
471
bin/why3.opt: lib/why3/why3.cmxa src/tools/main.cmx
472 473 474
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
475
bin/why3.byte: lib/why3/why3.cma src/tools/main.cmo
476 477
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^
478

479 480 481 482 483 484 485 486
bin/why3config.opt: lib/why3/why3.cmxa src/tools/why3config.cmx
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^

bin/why3config.byte: lib/why3/why3.cma src/tools/why3config.cmo
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
487
bin/why3execute.opt: lib/why3/why3.cmxa src/tools/why3execute.cmx
488 489 490
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
491
bin/why3execute.byte: lib/why3/why3.cma src/tools/why3execute.cmo
492 493 494
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
495
bin/why3extract.opt: lib/why3/why3.cmxa src/tools/why3extract.cmx
496 497 498
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
499
bin/why3extract.byte: lib/why3/why3.cma src/tools/why3extract.cmo
500 501 502
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
503
bin/why3prove.opt: lib/why3/why3.cmxa src/tools/why3prove.cmx
504 505 506
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
507
bin/why3prove.byte: lib/why3/why3.cma src/tools/why3prove.cmo
508 509 510
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
511
bin/why3realize.opt: lib/why3/why3.cmxa src/tools/why3realize.cmx
512 513 514
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
515
bin/why3realize.byte: lib/why3/why3.cma src/tools/why3realize.cmo
516 517 518
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^

519
bin/why3replay.opt: lib/why3/why3.cmxa src/tools/why3replay.cmx
520 521 522
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^

523
bin/why3replay.byte: lib/why3/why3.cma src/tools/why3replay.cmo
524 525 526
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^

Andrei Paskevich's avatar
Andrei Paskevich committed
527 528 529 530 531 532 533 534
bin/why3wc.opt: src/tools/why3wc.cmx
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^

bin/why3wc.byte: src/tools/why3wc.cmo
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^

Jacques-Pascal Deplaix's avatar
Jacques-Pascal Deplaix committed
535
clean_old_install::
536
	rm -f $(TOOLS_BIN:%=$(TOOLDIR)/%$(EXE)) $(BINDIR)/why3$(EXE)
537
	rm -f $(BINDIR)/why3bench$(EXE) $(BINDIR)/why3replayer$(EXE)
Jacques-Pascal Deplaix's avatar
Jacques-Pascal Deplaix committed
538

539
install_no_local::
540
	cp -f bin/why3.@OCAMLBEST@ $(BINDIR)/why3$(EXE)
541
	cp -f bin/why3config.@OCAMLBEST@  $(TOOLDIR)/why3config$(EXE)
542 543 544
	cp -f bin/why3execute.@OCAMLBEST@ $(TOOLDIR)/why3execute$(EXE)
	cp -f bin/why3extract.@OCAMLBEST@ $(TOOLDIR)/why3extract$(EXE)
	cp -f bin/why3prove.@OCAMLBEST@   $(TOOLDIR)/why3prove$(EXE)
545
	cp -f bin/why3realize.@OCAMLBEST@ $(TOOLDIR)/why3realize$(EXE)
546
	cp -f bin/why3replay.@OCAMLBEST@  $(TOOLDIR)/why3replay$(EXE)
Andrei Paskevich's avatar
Andrei Paskevich committed
547
	cp -f bin/why3wc.@OCAMLBEST@      $(TOOLDIR)/why3wc$(EXE)
548 549

install_local:: bin/why3 $(addprefix bin/,$(TOOLS_BIN))
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
550

551
bin/%:	bin/%.@OCAMLBEST@
552
	ln -sf $(notdir $<) $@
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
553

554 555 556 557 558 559 560 561 562 563 564
install_local:: share/drivers share/modules share/theories

share/drivers:
	ln -snf ../drivers share/drivers

share/modules:
	ln -snf ../modules share/modules

share/theories:
	ln -snf ../theories share/theories

565
ifneq "$(MAKECMDGOALS:clean%=clean)" "clean"
566
include $(TOOLSDEP)
567 568
endif

569
depend: $(TOOLSDEP)
570

Andrei Paskevich's avatar
Andrei Paskevich committed
571 572 573
CLEANDIRS += src/tools
GENERATED += $(TOOLSGENERATED)

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
574
clean::
Andrei Paskevich's avatar
Andrei Paskevich committed
575
	rm -f bin/why3*
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
576

577 578 579
##############
# test targets
##############
580

581 582
%.gui: %.why bin/why3ide.opt
	bin/why3ide.opt $*.why
583

584 585
%: %.mlw bin/why3.opt
	bin/why3.opt $*.mlw
586

587 588
%: %.why bin/why3.opt
	bin/why3.opt $*.why
François Bobot's avatar
François Bobot committed
589

590 591
%.gui: %.mlw bin/why3ide.opt
	bin/why3ide.opt $*.mlw
592

593
%.type: %.mlw bin/why3ide.opt
594
	bin/why3.opt --type-only $*.mlw
595

596 597 598 599
##########
# gallery
##########

600
# we export exactly the programs that have a why3session.xml file
601 602 603

.PHONY: gallery

604 605
gallery::
	@if test "$(GALLERYDIR)" = ""; then echo "set GALLERYDIR first"; exit 1; fi
Andrei Paskevich's avatar
Andrei Paskevich committed
606
	@for x in examples/*/why3session.xml ; do \
607 608
	  d=`dirname $$x`; \
	  f=`basename $$d`; \
609
	  why3 session html $$x; \
610 611
	  echo "exporting $$f"; \
	  mkdir -p $(GALLERYDIR)/$$f; \
612
	  cp examples/$$f.mlw examples/$$f/why3session.html $(GALLERYDIR)/$$f/; \
613
	  rm -f $(GALLERYDIR)/$$f/$$f.zip; \
Andrei Paskevich's avatar
Andrei Paskevich committed
614
	  cd examples/; \
615
	  zip -r $(GALLERYDIR)/$$f/$$f.zip $$f.mlw $$f; \
616
	  cd ..; \
617
	done
618

619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
.PHONY: gallery-subs

GALLERYSUBS=avl

gallery-subs::
	@for d in $(GALLERYSUBS) ; do \
	  echo "exporting examples/$$d"; \
	  rm -f $(GALLERYDIR)/$$d/$$d.zip; \
	  cd examples/$$d; \
	  why3 -L . doc --stdlib-url http://why3.lri.fr/stdlib/ *.mlw -o $(GALLERYDIR)/$$d; \
	  cd ..; \
	  zip -r $(GALLERYDIR)/$$d/$$d.zip $$d; \
	  cd ..; \
	done


635 636 637 638 639
%-gallery::
	@if test "$(GALLERYDIR)" = ""; then echo "set GALLERYDIR first"; exit 1; fi
	x=$*/why3session.xml; \
	d=`dirname $$x`; \
	f=`basename $$d`; \
640
	why3 session html $$x; \
641 642
	echo "exporting $$f"; \
	mkdir -p $(GALLERYDIR)/$$f; \
643 644
	if test -f examples/$$f.mlw; then cp examples/$$f.mlw $(GALLERYDIR)/$$f/; fi; \
	if test -f examples/$$f.why; then cp examples/$$f.why $(GALLERYDIR)/$$f/; fi; \
645
	cp examples/$$f/why3session.html $(GALLERYDIR)/$$f/; \
646 647
	rm -f $(GALLERYDIR)/$$f/$$f.zip; \
	cd examples/; \
648
	zip -r $(GALLERYDIR)/$$f/$$f.zip $$f.mlw $$f
649

MARCHE Claude's avatar
MARCHE Claude committed
650 651 652 653 654 655 656 657
########
# XML DTD validation
########

.PHONY: xml-validate

xml-validate:
	@for x in `find examples/ -name why3session.xml`; do \
MARCHE Claude's avatar
MARCHE Claude committed
658
	  xmllint --noout --valid $$x 2>&1 | head -1; \
MARCHE Claude's avatar
MARCHE Claude committed
659 660
	done

661 662 663 664 665
xml-validate-local:
	@for x in `find examples/ -name why3session.xml`; do \
	  xmllint --noout --dtdvalid share/why3session.dtd $$x 2>&1 | head -1; \
	done

MARCHE Claude's avatar
MARCHE Claude committed
666 667 668 669
###############
# IDE
###############

670 671
ifeq (@enable_ide@,yes)

François Bobot's avatar
François Bobot committed
672
IDE_FILES = gconfig gmain
MARCHE Claude's avatar
MARCHE Claude committed
673 674 675

IDEMODULES = $(addprefix src/ide/, $(IDE_FILES))

Andrei Paskevich's avatar
Andrei Paskevich committed
676
IDEDEP = $(addsuffix .dep, $(IDEMODULES))
MARCHE Claude's avatar
MARCHE Claude committed
677 678 679
IDECMO = $(addsuffix .cmo, $(IDEMODULES))
IDECMX = $(addsuffix .cmx, $(IDEMODULES))

Andrei Paskevich's avatar
Andrei Paskevich committed
680
$(IDEDEP): DEPFLAGS += -I src/ide
681
$(IDECMO) $(IDECMX): INCLUDES += -I src/ide
MARCHE Claude's avatar
MARCHE Claude committed
682

683
# build targets
MARCHE Claude's avatar
MARCHE Claude committed
684

685 686
byte: bin/why3ide.byte
opt:  bin/why3ide.opt
MARCHE Claude's avatar
MARCHE Claude committed
687

688
bin/why3ide.opt bin/why3ide.byte: INCLUDES += -I @LABLGTK2LIB@
Andrei Paskevich's avatar
Andrei Paskevich committed
689
bin/why3ide.opt bin/why3ide.byte: EXTLIBS += lablgtk lablgtksourceview2
MARCHE Claude's avatar
MARCHE Claude committed
690

691
bin/why3ide.opt: lib/why3/why3.cmxa src/ide/resetgc.o $(IDECMX)
Andrei Paskevich's avatar
Andrei Paskevich committed
692
	$(if $(QUIET),@echo 'Linking  $@' &&) \
693
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^
MARCHE Claude's avatar
MARCHE Claude committed
694

695
bin/why3ide.byte: lib/why3/why3.cma src/ide/resetgc.o $(IDECMO)
MARCHE Claude's avatar
MARCHE Claude committed
696
	$(if $(QUIET),@echo 'Linking  $@' &&) \
697
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) -custom $^
MARCHE Claude's avatar
MARCHE Claude committed
698

699
src/ide/resetgc.o: src/ide/resetgc.c
700 701
	$(if $(QUIET),@echo 'Ocamlc   $<' &&) \
	    $(OCAMLC) -c -ccopt "-Wall -o $@" $<
702

MARCHE Claude's avatar
MARCHE Claude committed
703 704
# depend and clean targets

705
ifneq "$(MAKECMDGOALS:clean%=clean)" "clean"
Andrei Paskevich's avatar
Andrei Paskevich committed
706 707
include $(IDEDEP)
endif
MARCHE Claude's avatar
MARCHE Claude committed
708

Andrei Paskevich's avatar
Andrei Paskevich committed
709
depend: $(IDEDEP)
MARCHE Claude's avatar
MARCHE Claude committed
710

Andrei Paskevich's avatar
Andrei Paskevich committed
711
CLEANDIRS += src/ide
MARCHE Claude's avatar
MARCHE Claude committed
712

Jacques-Pascal Deplaix's avatar
Jacques-Pascal Deplaix committed
713 714 715
clean_old_install::
	rm -f $(BINDIR)/why3ide$(EXE)

716
install_no_local::
717
	cp -f bin/why3ide.@OCAMLBEST@ $(TOOLDIR)/why3ide$(EXE)
718

719
install_local:: bin/why3ide
720

721
endif
MARCHE Claude's avatar
d  
MARCHE Claude committed
722

723 724 725 726
###############
# Session
###############

Andrei Paskevich's avatar
Andrei Paskevich committed
727 728 729
SESSION_FILES = why3session_lib why3session_copy why3session_info \
		why3session_latex why3session_html why3session_rm \
		why3session_output why3session_run why3session_csv \
730
		why3session_main
731 732 733

SESSIONMODULES = $(addprefix src/why3session/, $(SESSION_FILES))

Andrei Paskevich's avatar
Andrei Paskevich committed
734
SESSIONDEP = $(addsuffix .dep, $(SESSIONMODULES))
735 736 737
SESSIONCMO = $(addsuffix .cmo, $(SESSIONMODULES))
SESSIONCMX = $(addsuffix .cmx, $(SESSIONMODULES))

Andrei Paskevich's avatar
Andrei Paskevich committed
738
$(SESSIONDEP): DEPFLAGS += -I src/why3session
739 740 741 742 743 744 745
$(SESSIONCMO) $(SESSIONCMX): INCLUDES += -I src/why3session

# build targets

byte: bin/why3session.byte
opt:  bin/why3session.opt

746
bin/why3session.opt: lib/why3/why3.cmxa $(SESSIONCMX)
Andrei Paskevich's avatar
Andrei Paskevich committed
747
	$(if $(QUIET),@echo 'Linking  $@' &&) \
748
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^
749

750
bin/why3session.byte: lib/why3/why3.cma $(SESSIONCMO)
751
	$(if $(QUIET),@echo 'Linking  $@' &&) \
752
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^
753 754 755

# depend and clean targets

756
ifneq "$(MAKECMDGOALS:clean%=clean)" "clean"
Andrei Paskevich's avatar
Andrei Paskevich committed
757 758
include $(SESSIONDEP)
endif
759

Andrei Paskevich's avatar
Andrei Paskevich committed
760
depend: $(SESSIONDEP)
761

Andrei Paskevich's avatar
Andrei Paskevich committed
762
CLEANDIRS += src/why3session
763

Jacques-Pascal Deplaix's avatar
Jacques-Pascal Deplaix committed
764 765 766
clean_old_install::
	rm -f $(BINDIR)/why3session$(EXE)

767
install_no_local::
768
	cp -f bin/why3session.@OCAMLBEST@ $(TOOLDIR)/why3session$(EXE)
769

770
install_local:: bin/why3session
771

MARCHE Claude's avatar
MARCHE Claude committed
772

773 774 775
##############
# Coq plugin
##############
776

Andrei Paskevich's avatar
Andrei Paskevich committed
777
ifeq (@enable_coq_tactic@,yes)
778

779
COQPGENERATED = src/coq-tactic/why3tac.ml
780

781
COQP_FILES = why3tac
782

783
COQPMODULES = $(addprefix src/coq-tactic/, $(COQP_FILES))
784

785 786 787
COQPDEP = $(addsuffix .dep, $(COQPMODULES))
COQPCMO = $(addsuffix .cmo, $(COQPMODULES))
COQPCMX = $(addsuffix .cmx, $(COQPMODULES))
788

789
COQPTREES = kernel interp intf lib library parsing pretyping proofs printing tactics toplevel
790
COQPINCLUDES = -I src/coq-tactic -I $(COQCAMLPLIB) $(addprefix -I @COQLIB@/, $(COQPTREES)) @ZIPINCLUDE@
791

792
$(COQPDEP): DEPFLAGS += -I src/coq-tactic
793
$(COQPCMO) $(COQPCMX): INCLUDES += $(COQPINCLUDES)
Andrei Paskevich's avatar
Andrei Paskevich committed
794 795
$(COQPCMO) $(COQPCMX): BFLAGS += -rectypes
$(COQPCMX): OFLAGS += -rectypes
796

797
$(COQPDEP): $(COQPGENERATED)
798

799 800
byte: src/coq-tactic/.why3-vo-byte
opt:  src/coq-tactic/.why3-vo-opt
801

802 803 804 805
lib/coq-tactic/why3tac.cmxs: OFLAGS += $(addsuffix .cmxa, @ZIPLIB@)
lib/coq-tactic/why3tac.cmxs: OFLAGS += $(addsuffix .cmx,  @MENHIRLIB@)

lib/coq-tactic/why3tac.cma:  BFLAGS += $(addsuffix .cma,  @ZIPLIB@)
806
lib/coq-tactic/why3tac.cma:  BFLAGS += $(addsuffix .cmo,  @MENHIRLIB@)
807

808
lib/coq-tactic/why3tac.cmxs: lib/why3/why3.cmxa $(COQPCMX)
Andrei Paskevich's avatar
Andrei Paskevich committed
809
	$(if $(QUIET),@echo 'Linking  $@' &&) \
810
	    $(OCAMLOPT) $(OFLAGS) -o $@ -shared $^
811

812
lib/coq-tactic/why3tac.cma: lib/why3/why3.cma $(COQPCMO)
Andrei Paskevich's avatar
Andrei Paskevich committed
813
	$(if $(QUIET),@echo 'Linking  $@' &&) \
814
	    $(OCAMLC) -a $(BFLAGS) -o $@ $^
815

816
src/coq-tactic/why3tac.ml: src/coq-tactic/why3tac.ml4
817
	$(if $(QUIET),@echo 'Camlp    $<' &&) \
François Bobot's avatar
François Bobot committed
818
	    $(COQCAMLP) pr_dump.cmo @COQPPLIBS@ pa_macro.cmo -D@coq_compat_version@ -impl $^ -o $@
819

820
src/coq-tactic/.why3-vo-byte: lib/coq-tactic/Why3.v lib/coq/BuiltIn.vo lib/coq-tactic/why3tac.cma
Andrei Paskevich's avatar
Andrei Paskevich committed
821
	$(if $(QUIET),@echo 'Coqc     $<' &&) \
822
	    WHY3CONFIG="" $(COQC) -byte -R lib/coq-tactic Why3 -R lib/coq Why3 $< && \
823
	    touch src/coq-tactic/.why3-vo-byte
824

825
src/coq-tactic/.why3-vo-opt: lib/coq-tactic/Why3.v lib/coq/BuiltIn.vo lib/coq-tactic/why3tac.cmxs
Andrei Paskevich's avatar
Andrei Paskevich committed
826
	$(if $(QUIET),@echo 'Coqc     $<' &&) \
827
	    WHY3CONFIG="" $(COQC) -opt -R lib/coq-tactic Why3 -R lib/coq Why3 $< && \
828
	    touch src/coq-tactic/.why3-vo-opt
829

830
# depend and clean targets
Andrei Paskevich's avatar
Andrei Paskevich committed
831

832
ifneq "$(MAKECMDGOALS:clean%=clean)" "clean"
833
include $(COQPDEP)
Andrei Paskevich's avatar
Andrei Paskevich committed
834
endif
835

836
depend: $(COQPDEP)
837

Andrei Paskevich's avatar
Andrei Paskevich committed
838 839 840 841
CLEANDIRS += src/coq-tactic
CLEANLIBS += lib/coq-tactic/why3tac
GENERATED += $(COQPGENERATED)

842
clean::
843 844
	rm -f lib/coq-tactic/*.vo lib/coq-tactic/*.glob
	rm -f src/coq-tactic/.why3-vo-*
845

846
install_no_local::
847 848
	mkdir -p $(LIBDIR)/why3/coq-tactic
	cp -f lib/coq-tactic/* $(LIBDIR)/why3/coq-tactic
849

850 851 852 853 854 855
endif

####################
# Coq realizations
####################

856 857
ifeq (@enable_coq_support@,yes)

858 859
ifeq (@enable_coq_libs@,yes)

860
COQLIBS_INT_FILES = Abs ComputerDivision Div2 EuclideanDivision Int MinMax Power NumOf
861 862
COQLIBS_INT_ALL_FILES = Exponentiation $(COQLIBS_INT_FILES)
COQLIBS_INT = $(addprefix lib/coq/int/, $(COQLIBS_INT_ALL_FILES))
863

864 865 866
COQLIBS_BOOL_FILES = Bool
COQLIBS_BOOL = $(addprefix lib/coq/bool/, $(COQLIBS_BOOL_FILES))

867
COQLIBS_REAL_FILES = Abs ExpLog FromInt MinMax PowerInt PowerReal Real RealInfix Square Trigonometry
868 869
COQLIBS_REAL = $(addprefix lib/coq/real/, $(COQLIBS_REAL_FILES))

870
COQLIBS_NUMBER_FILES = Divisibility Gcd Parity Prime Coprime
871 872
COQLIBS_NUMBER = $(addprefix lib/coq/number/, $(COQLIBS_NUMBER_FILES))

873 874 875
COQLIBS_SET_FILES = Set
COQLIBS_SET = $(addprefix lib/coq/set/, $(COQLIBS_SET_FILES))

MARCHE Claude's avatar
MARCHE Claude committed
876
COQLIBS_MAP_FILES = Map Const Occ MapPermut MapInjection
877 878
COQLIBS_MAP = $(addprefix lib/coq/map/, $(COQLIBS_MAP_FILES))

879
COQLIBS_LIST_FILES = List Length Mem Nth NthLength HdTl NthHdTl Append NthLengthAppend Reverse HdTlNoOpt NthNoOpt RevAppend Combine Distinct NumOcc Permut
880 881 882 883 884
COQLIBS_LIST = $(addprefix lib/coq/list/, $(COQLIBS_LIST_FILES))

COQLIBS_OPTION_FILES = Option
COQLIBS_OPTION = $(addprefix lib/coq/option/, $(COQLIBS_OPTION_FILES))

885 886 887
COQLIBS_SEQ_FILES = Seq
COQLIBS_SEQ = $(addprefix lib/coq/seq/, $(COQLIBS_SEQ_FILES))

Clément Fumex's avatar
Clément Fumex committed
888 889 890
COQLIBS_BV_FILES = Pow2int BV_Gen
COQLIBS_BV = $(addprefix lib/coq/bv/, $(COQLIBS_BV_FILES))

891
ifeq (@enable_coq_fp_libs@,yes)
892
COQLIBS_FP_FILES = Rounding SingleFormat Single DoubleFormat Double
893 894 895
COQLIBS_FP_ALL_FILES = GenFloat $(COQLIBS_FP_FILES)
COQLIBS_FP = $(addprefix lib/coq/floating_point/, $(COQLIBS_FP_ALL_FILES))
endif
896

Clément Fumex's avatar
Clément Fumex committed
897
COQLIBS_FILES = lib/coq/BuiltIn lib/coq/HighOrd $(COQLIBS_INT) $(COQLIBS_BOOL) $(COQLIBS_REAL) $(COQLIBS_NUMBER) $(COQLIBS_SET) $(COQLIBS_MAP) $(COQLIBS_LIST) $(COQLIBS_OPTION) $(COQLIBS_SEQ) $(COQLIBS_FP)  $(COQLIBS_BV)
898

899 900 901
drivers/coq-realizations.aux: Makefile
	$(if $(QUIET),@echo 'Generate $@' &&) \
	(echo "(* generated automatically at compilation time *)"; \
Andrei Paskevich's avatar
Andrei Paskevich committed
902
	echo 'theory BuiltIn meta "realized_theory" "BuiltIn", "" end'; \
903
	echo 'theory HighOrd meta "realized_theory" "HighOrd", "" end'; \
Andrei Paskevich's avatar
Andrei Paskevich committed
904
	for f in $(COQLIBS_INT_FILES); do \
Andrei Paskevich's avatar
Andrei Paskevich committed
905
	echo 'theory int.'"$$f"' meta "realized_theory" "int.'"$$f"'", "" end'; done; \
906 907
	for f in $(COQLIBS_BOOL_FILES); do \
	echo 'theory bool.'"$$f"' meta "realized_theory" "bool.'"$$f"'", "" end'; done; \
Andrei Paskevich's avatar
Andrei Paskevich committed
908
	for f in $(COQLIBS_REAL_FILES); do \
Andrei Paskevich's avatar
Andrei Paskevich committed
909
	echo 'theory real.'"$$f"' meta "realized_theory" "real.'"$$f"'", "" end'; done; \
910
	for f in $(COQLIBS_NUMBER_FILES); do \
Andrei Paskevich's avatar
Andrei Paskevich committed
911
	echo 'theory number.'"$$f"' meta "realized_theory" "number.'"$$f"'", "" end'; done; \
Guillaume Melquiond's avatar