Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Makefile.in 59.5 KB
Newer Older
Andrei Paskevich's avatar
Andrei Paskevich committed
1 2 3
####################################################################
#                                                                  #
#  The Why3 Verification Platform   /   The Why3 Development Team  #
Andrei Paskevich's avatar
Andrei Paskevich committed
4
#  Copyright 2010-2013   --   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

Andrei Paskevich's avatar
Andrei Paskevich committed
12
include Version
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
13

14 15 16 17 18 19
VERBOSEMAKE ?= @enable_verbose_make@

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

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

25
prefix	    = @prefix@
26 27 28 29 30
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@

BINDIR  = $(DESTDIR)@bindir@
LIBDIR  = $(DESTDIR)@libdir@
31
DATADIR = $(DESTDIR)@datarootdir@
32
MANDIR  = $(DESTDIR)@mandir@
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
33

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

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

54
DEPFLAGS  = -slash -I lib/why3
55
ifeq (@OCAMLBEST@,opt)
Andrei Paskevich's avatar
Andrei Paskevich committed
56
DEPFLAGS += -native
57 58
endif

59
RUBBER = @RUBBER@
60
HEVEA = @HEVEA@
61
HACHA = @HACHA@
62

63
#PSVIEWER  = @PSVIEWER@
Andrei Paskevich's avatar
Andrei Paskevich committed
64
#PDFVIEWER = @PDFVIEWER@
65

66
INCLUDES = @BIGINTINCLUDE@
67 68
OFLAGS = -w Aer-41-44-45 -dtypes -g -I lib/why3 $(INCLUDES)
BFLAGS = -w Aer-41-44-45 -dtypes -g -I lib/why3 $(INCLUDES)
69 70 71

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

73
ifeq (@enable_profiling@,yes)
74 75 76
OFLAGS += -g -p
endif

77 78
# external libraries common to all binaries

79
EXTOBJS =
80
EXTLIBS = str unix @BIGINTLIB@ dynlink 
81 82 83

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
84

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
85 86 87
###############
# main target
###############
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
88

89 90 91 92
all: @OCAMLBEST@
plugins: plugins.@OCAMLBEST@
opt: plugins.opt
byte: plugins.byte
Francois Bobot's avatar
Francois Bobot committed
93

94 95 96 97 98
ifeq (@enable_local@,yes)
all: install_local
endif

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

101 102 103
##############
# Why3 library
##############
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
104

105
LIBGENERATED = src/util/config.ml src/util/rc.ml src/parser/lexer.ml \
106 107
	       src/parser/parser.mli src/parser/parser.ml \
	       src/driver/driver_parser.mli src/driver/driver_parser.ml \
108
	       src/driver/driver_lexer.ml src/session/xml.ml
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
109

110
LIB_UTIL = config util opt lists strings extmap extset exthtbl weakhtbl \
111
	   hashcons stdlib exn_printer pp debug loc print_tree \
112
	   cmdline warning sysutil rc plugin bigInt number pqueue
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
113

114 115
LIB_CORE = ident ty term pattern decl theory \
	   task pretty dterm env trans printer
116

117
LIB_PARSER = ptree glob parser typing lexer
118

119
LIB_DRIVER = call_provers driver_ast driver_parser driver_lexer driver \
120
	     whyconf autodetection
121

122
LIB_TRANSFORM = simplify_formula inlining split_goal induction \
123
		eliminate_definition eliminate_algebraic \
124
		eliminate_inductive eliminate_let eliminate_if \
125 126 127 128
		libencoding discriminate encoding encoding_select \
		encoding_guards_full encoding_tags_full \
		encoding_guards encoding_tags encoding_twin \
		encoding_sort simplify_array filter_trigger \
129
		introduction abstraction close_epsilon lift_epsilon \
130
		eliminate_epsilon \
131
		eval_match instantiate_predicate smoke_detector
132

133
LIB_PRINTER = alt_ergo why3printer smtv1 smtv2 coq pvs isabelle \
134
	      simplify gappa cvc3 yices mathematica
135

François Bobot's avatar
François Bobot committed
136 137
LIB_SESSION = xml termcode session session_tools session_scheduler

138
LIB_WHYML = mlw_ty mlw_expr mlw_decl mlw_pretty mlw_wp mlw_module \
139
	    mlw_dexpr mlw_typing mlw_driver mlw_ocaml \
140
	    mlw_main mlw_interp
141 142

LIBMODULES =  $(addprefix src/util/, $(LIB_UTIL)) \
143 144 145 146
	      $(addprefix src/core/, $(LIB_CORE)) \
	      $(addprefix src/parser/, $(LIB_PARSER)) \
	      $(addprefix src/driver/, $(LIB_DRIVER)) \
	      $(addprefix src/transform/, $(LIB_TRANSFORM)) \
François Bobot's avatar
François Bobot committed
147
	      $(addprefix src/printer/, $(LIB_PRINTER)) \
148 149
	      $(addprefix src/session/, $(LIB_SESSION)) \
	      $(addprefix src/whyml/, $(LIB_WHYML))
150

151
LIBDIRS = util core parser driver transform printer session whyml
152
LIBINCLUDES = $(addprefix -I src/, $(LIBDIRS))
MARCHE Claude's avatar
MARCHE Claude committed
153

Andrei Paskevich's avatar
Andrei Paskevich committed
154
LIBDEP = $(addsuffix .dep, $(LIBMODULES))
155 156
LIBCMO = $(addsuffix .cmo, $(LIBMODULES))
LIBCMX = $(addsuffix .cmx, $(LIBMODULES))
157

Andrei Paskevich's avatar
Andrei Paskevich committed
158
$(LIBDEP): DEPFLAGS += $(LIBINCLUDES)
159
$(LIBCMO) $(LIBCMX): INCLUDES += $(LIBINCLUDES)
160
$(LIBCMX): OFLAGS += -for-pack Why3
161

162 163
$(LIBDEP): $(LIBGENERATED)

164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
# Zarith

ifeq (@enable_zarith@,yes)

src/util/bigInt.ml: src/util/bigInt_ocamlnum.ml src/util/bigInt_zarith.ml
	cp src/util/bigInt_zarith.ml src/util/bigInt.ml

else

src/util/bigInt.ml: src/util/bigInt_ocamlnum.ml
	cp src/util/bigInt_ocamlnum.ml src/util/bigInt.ml

endif


179
# build targets
180

181 182
byte: lib/why3/why3.cma
opt:  lib/why3/why3.cmxa
183

184
lib/why3/why3.cma: lib/why3/why3.cmo
Andrei Paskevich's avatar
Andrei Paskevich committed
185 186
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) -a $(BFLAGS) -o $@ $^
187

188
lib/why3/why3.cmxa: lib/why3/why3.cmx
Andrei Paskevich's avatar
Andrei Paskevich committed
189 190
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) -a $(OFLAGS) -o $@ $^
191

192
lib/why3/why3.cmo: $(LIBCMO)
Andrei Paskevich's avatar
Andrei Paskevich committed
193 194
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLC) $(BFLAGS) -pack -o $@ $^
195

196
lib/why3/why3.cmx: $(LIBCMX)
Andrei Paskevich's avatar
Andrei Paskevich committed
197 198
	$(if $(QUIET),@echo 'Linking  $@' &&) \
	    $(OCAMLOPT) $(OFLAGS) -pack -o $@ $^
199

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

Andrei Paskevich's avatar
Andrei Paskevich committed
202 203 204
ifneq "$(MAKECMDGOALS)" "clean"
include $(LIBDEP)
endif
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
205

206
depend: $(LIBDEP)
207

Andrei Paskevich's avatar
Andrei Paskevich committed
208
LIBSDIRS = src $(addprefix src/, $(LIBDIRS))
209 210
LIBCLEAN = $(addsuffix /*.cm[iox], $(LIBSDIRS)) \
	   $(addsuffix /*.annot, $(LIBSDIRS)) \
211 212
	   $(addsuffix /*.output, $(LIBSDIRS)) \
	   $(addsuffix /*.automaton, $(LIBSDIRS)) \
Andrei Paskevich's avatar
Andrei Paskevich committed
213
	   $(addsuffix /*.dep, $(LIBSDIRS)) \
214 215 216 217 218
	   $(addsuffix /*.o, $(LIBSDIRS)) \
	   $(addsuffix /*~, $(LIBSDIRS))

clean::
	rm -f $(LIBCLEAN) $(LIBGENERATED)
219
	rm -f lib/why3/why3.cm* lib/why3/why3.[ao]
220

221 222 223
###############
# installation
###############
224

MARCHE Claude's avatar
MARCHE Claude committed
225 226 227
clean_old_install:
	rm -f $(BINDIR)/why3*
	rm -rf $(DATADIR)/why3
228
	rm -rf $(OCAMLINSTALLLIB)/why3
MARCHE Claude's avatar
MARCHE Claude committed
229

230 231

install_no_local:: clean_old_install
232
	mkdir -p $(BINDIR)
233
	mkdir -p $(DATADIR)/why3
234
	mkdir -p $(DATADIR)/why3/images
235 236
	mkdir -p $(DATADIR)/why3/images/boomy
	mkdir -p $(DATADIR)/why3/images/fatcow
MARCHE Claude's avatar
MARCHE Claude committed
237
	mkdir -p $(DATADIR)/why3/emacs
238
	mkdir -p $(DATADIR)/why3/vim
239
	mkdir -p $(DATADIR)/why3/lang
MARCHE Claude's avatar
MARCHE Claude committed
240
	mkdir -p $(DATADIR)/why3/theories
241
	mkdir -p $(DATADIR)/why3/modules/mach
MARCHE Claude's avatar
MARCHE Claude committed
242 243
	mkdir -p $(DATADIR)/why3/drivers
	cp -f theories/*.why $(DATADIR)/why3/theories
244
	cp -f modules/*.mlw $(DATADIR)/why3/modules
245
	cp -f modules/mach/*.mlw $(DATADIR)/why3/modules/mach
Andrei Paskevich's avatar
Andrei Paskevich committed
246
	cp -f drivers/*.drv drivers/*.gen $(DATADIR)/why3/drivers
247
	cp -f share/provers-detection-data.conf $(DATADIR)/why3/
248
	cp -f share/images/icons.rc $(DATADIR)/why3/images
249
	cp -f share/images/*.png $(DATADIR)/why3/images
250 251
	cp -f share/images/boomy/*.png $(DATADIR)/why3/images/boomy
	cp -f share/images/fatcow/*.png $(DATADIR)/why3/images/fatcow
252
	cp -f share/why3session.dtd $(DATADIR)/why3
253
	cp -rf share/javascript $(DATADIR)/why3/javascript
254 255 256
	cp -f share/emacs/why3.el $(DATADIR)/why3/emacs/why3.el
	cp -f share/vim/why3.vim $(DATADIR)/why3/vim/why3.vim
	cp -f share/lang/why3.lang $(DATADIR)/why3/lang/why3.lang
257

MARCHE Claude's avatar
MARCHE Claude committed
258
install_no_local_lib::
259
	mkdir -p $(OCAMLINSTALLLIB)/why3
Andrei Paskevich's avatar
Andrei Paskevich committed
260
	cp -f lib/why3/why3.cm* lib/why3/why3.[ao] \
261
		lib/why3/META $(OCAMLINSTALLLIB)/why3
MARCHE Claude's avatar
MARCHE Claude committed
262

263 264
ifeq (@enable_local@,yes)
install install-lib:
265 266
	@echo "Why3 is configured in local installation mode."
	@echo "To install Why3, run ./configure --disable-local ; make ; make install"
267
else
MARCHE Claude's avatar
MARCHE Claude committed
268
install: clean_old_install install_no_local
MARCHE Claude's avatar
MARCHE Claude committed
269
install-lib: install_no_local_lib
270 271
endif

MARCHE Claude's avatar
MARCHE Claude committed
272 273
install-all: install install-lib

274
##################
275
# Why3 plugins
276 277
##################

Andrei Paskevich's avatar
Andrei Paskevich committed
278
PLUGGENERATED = plugins/tptp/tptp_lexer.ml \
279 280
		plugins/tptp/tptp_parser.ml plugins/tptp/tptp_parser.mli \
		plugins/parser/dimacs.ml \
281

282
PLUG_PARSER = genequlin dimacs
283
PLUG_PRINTER =
284
PLUG_TRANSFORM =
285
PLUG_TPTP = tptp_ast tptp_parser tptp_typing tptp_lexer tptp_printer
286

287
PLUGINS = genequlin dimacs tptp
288

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

Andrei Paskevich's avatar
Andrei Paskevich committed
291 292
TPTPCMO = $(addsuffix .cmo, $(TPTPMODULES))
TPTPCMX = $(addsuffix .cmx, $(TPTPMODULES))
293

294 295 296 297 298 299 300 301 302 303
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

304 305
PLUGMODULES = $(addprefix plugins/parser/, $(PLUG_PARSER)) \
	      $(addprefix plugins/printer/, $(PLUG_PRINTER)) \
Andrei Paskevich's avatar
Andrei Paskevich committed
306
	      $(addprefix plugins/transform/, $(PLUG_TRANSFORM)) \
Andrei Paskevich's avatar
Andrei Paskevich committed
307
	      $(TPTPMODULES)
308

Andrei Paskevich's avatar
Andrei Paskevich committed
309
PLUGDEP = $(addsuffix .dep, $(PLUGMODULES))
310 311 312
PLUGCMO = $(addsuffix .cmo, $(PLUGMODULES))
PLUGCMX = $(addsuffix .cmx, $(PLUGMODULES))

Andrei Paskevich's avatar
Andrei Paskevich committed
313
PLUGDIRS = parser printer transform tptp
314 315
PLUGINCLUDES = $(addprefix -I plugins/, $(PLUGDIRS))

Andrei Paskevich's avatar
Andrei Paskevich committed
316
$(PLUGDEP): DEPFLAGS += $(PLUGINCLUDES)
317 318
$(PLUGCMO) $(PLUGCMX): INCLUDES += $(PLUGINCLUDES)

319 320
$(PLUGDEP): $(PLUGGENERATED)

321 322 323 324 325
LIBPLUGCMO =  $(addsuffix .cmo,  $(addprefix lib/plugins/, $(PLUGINS)))
LIBPLUGCMXS = $(addsuffix .cmxs, $(addprefix lib/plugins/, $(PLUGINS)))

plugins.byte: $(LIBPLUGCMO)
plugins.opt : $(LIBPLUGCMXS)
326 327

lib/plugins/%.cmxs: plugins/parser/%.cmx
Andrei Paskevich's avatar
Andrei Paskevich committed
328
	$(if $(QUIET),@echo 'Linking  $@' &&) \
329 330 331 332 333 334 335
	    $(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
336
	$(if $(QUIET),@echo 'Linking  $@' &&) \
337 338 339 340 341 342 343
	    $(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
344
	$(if $(QUIET),@echo 'Linking  $@' &&) \
345 346 347 348 349 350
	    $(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
351
lib/plugins/tptp.cmxs: $(TPTPCMX)
Andrei Paskevich's avatar
Andrei Paskevich committed
352
	$(if $(QUIET),@echo 'Linking  $@' &&) \
Andrei Paskevich's avatar
Andrei Paskevich committed
353
	    $(OCAMLOPT) $(OFLAGS) -shared -o $@ $^
354

Andrei Paskevich's avatar
Andrei Paskevich committed
355
lib/plugins/tptp.cmo: $(TPTPCMO)
Andrei Paskevich's avatar
Andrei Paskevich committed
356
	$(if $(QUIET),@echo 'Linking  $@' &&) \
Andrei Paskevich's avatar
Andrei Paskevich committed
357
	    $(OCAMLC) $(BFLAGS) -pack -o $@ $^
358 359 360 361 362 363

PLUGSDIRS = plugins $(addprefix plugins/, $(PLUGDIRS))
PLUGCLEAN = $(addsuffix /*.cm[iox], $(PLUGSDIRS)) \
	    $(addsuffix /*.annot, $(PLUGSDIRS)) \
	    $(addsuffix /*.output, $(PLUGSDIRS)) \
	    $(addsuffix /*.automaton, $(PLUGSDIRS)) \
Andrei Paskevich's avatar
Andrei Paskevich committed
364
	    $(addsuffix /*.dep, $(PLUGSDIRS)) \
365 366 367
	    $(addsuffix /*.o, $(PLUGSDIRS)) \
	    $(addsuffix /*~, $(PLUGSDIRS))

Andrei Paskevich's avatar
Andrei Paskevich committed
368 369 370 371 372 373
# depend and clean targets

ifneq "$(MAKECMDGOALS)" "clean"
include $(PLUGDEP)
endif

374
depend: $(PLUGDEP)
Andrei Paskevich's avatar
Andrei Paskevich committed
375

376 377 378 379 380
clean::
	rm -f $(PLUGCLEAN) $(PLUGGENERATED)
	rm -f lib/plugins/*

install_no_local::
381
	rm -rf $(LIBDIR)/why3/plugins
382
	mkdir -p $(LIBDIR)/why3/plugins
383
	cp -f $(foreach f,$(LIBPLUGCMO) $(LIBPLUGCMXS),$(wildcard $(f))) $(LIBDIR)/why3/plugins
384

385 386 387
######
# Why3
######
388

389 390
src/main.cmo: lib/why3/why3.cma
src/main.cmx: lib/why3/why3.cmxa
391

392 393
byte: bin/why3.byte
opt:  bin/why3.opt
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
394

395
bin/why3.opt: lib/why3/why3.cmxa src/main.cmx
Andrei Paskevich's avatar
Andrei Paskevich committed
396
	$(if $(QUIET),@echo 'Linking  $@' &&) \
397
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
398

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

403 404
bin/why3: bin/why3.@OCAMLBEST@
	ln -sf why3.@OCAMLBEST@ $@
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
405

406 407
install_no_local::
	cp -f bin/why3.@OCAMLBEST@ $(BINDIR)/why3$(EXE)
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
408

409
install_local: bin/why3
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
410

411 412 413 414 415 416
ifneq "$(MAKECMDGOALS)" "clean"
include src/main.dep
endif

depend: src/main.dep

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
417
clean::
418
	rm -f src/main.cm[iox] src/main.annot src/main.o src/main.dep
419
	rm -f bin/why3.byte bin/why3.opt bin/why3
420
	rm -f bin/why3ml.byte bin/why3ml.opt bin/why3ml
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
421

422 423 424
##############
# test targets
##############
425

426 427
%.gui: %.why bin/why3ide.opt
	bin/why3ide.opt $*.why
428

429 430
%: %.mlw bin/why3.opt
	bin/why3.opt $*.mlw
431

432 433
%: %.why bin/why3.opt
	bin/why3.opt $*.why
François Bobot's avatar
François Bobot committed
434

435 436
%.gui: %.mlw bin/why3ide.opt
	bin/why3ide.opt $*.mlw
437

438
%.type: %.mlw bin/why3ide.opt
439
	bin/why3.opt --type-only $*.mlw
440

441 442 443 444
##########
# gallery
##########

445
# we export exactly the programs that have a why3session.xml file
446 447 448

.PHONY: gallery

449 450
gallery::
	@if test "$(GALLERYDIR)" = ""; then echo "set GALLERYDIR first"; exit 1; fi
Andrei Paskevich's avatar
Andrei Paskevich committed
451
	@for x in examples/*/why3session.xml ; do \
452 453
	  d=`dirname $$x`; \
	  f=`basename $$d`; \
454
	  why3session html $$x; \
455 456
	  echo "exporting $$f"; \
	  mkdir -p $(GALLERYDIR)/$$f; \
457
	  cp examples/$$f.mlw examples/$$f/$$f.html $(GALLERYDIR)/$$f/; \
458
	  rm -f $(GALLERYDIR)/$$f/$$f.zip; \
Andrei Paskevich's avatar
Andrei Paskevich committed
459
	  cd examples/; \
460
	  zip -r $(GALLERYDIR)/$$f/$$f.zip $$f.mlw $$f/$$f.html  $$f; \
461
	  cd ..; \
462
	done
463

464 465 466 467 468 469 470 471
%-gallery::
	@if test "$(GALLERYDIR)" = ""; then echo "set GALLERYDIR first"; exit 1; fi
	x=$*/why3session.xml; \
	d=`dirname $$x`; \
	f=`basename $$d`; \
	why3session html $$x; \
	echo "exporting $$f"; \
	mkdir -p $(GALLERYDIR)/$$f; \
472 473 474
	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; \
	cp examples/$$f/$$f.html $(GALLERYDIR)/$$f/; \
475 476 477 478
	rm -f $(GALLERYDIR)/$$f/$$f.zip; \
	cd examples/; \
	zip -r $(GALLERYDIR)/$$f/$$f.zip $$f.mlw $$f/$$f.html  $$f

MARCHE Claude's avatar
MARCHE Claude committed
479 480 481 482 483 484 485 486
########
# XML DTD validation
########

.PHONY: xml-validate

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

490 491 492 493 494
xml-validate-local:
	@for x in `find examples/ -name why3session.xml`; do \
	  xmllint --noout --dtdvalid share/why3session.dtd $$x 2>&1 | head -1; \
	done

495 496 497 498
########
# Config
########

499
CONFIG_FILES = why3config
500

501
CONFIGMODULES = $(addprefix src/why3config/, $(CONFIG_FILES))
502

Andrei Paskevich's avatar
Andrei Paskevich committed
503
CONFIGDEP = $(addsuffix .dep, $(CONFIGMODULES))
504 505 506 507 508
CONFIGCMO = $(addsuffix .cmo, $(CONFIGMODULES))
CONFIGCMX = $(addsuffix .cmx, $(CONFIGMODULES))

# build targets

509 510
byte: bin/why3config.byte
opt:  bin/why3config.opt
511

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

516
bin/why3config.byte: lib/why3/why3.cma $(CONFIGCMO)
517
	$(if $(QUIET),@echo 'Linking  $@' &&) \
518
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^
519

520 521 522
bin/why3config: bin/why3config.@OCAMLBEST@
	ln -sf why3config.@OCAMLBEST@ $@

523 524
# depend and clean targets

Andrei Paskevich's avatar
Andrei Paskevich committed
525 526 527
ifneq "$(MAKECMDGOALS)" "clean"
include $(CONFIGDEP)
endif
528

Andrei Paskevich's avatar
Andrei Paskevich committed
529
depend: $(CONFIGDEP)
530 531

clean::
532 533 534
	rm -f src/why3config/*.cm[iox] src/why3config/*.o
	rm -f src/why3config/*.annot src/why3config/*.dep src/why3config/*~
	rm -f src/why3config/*.output src/why3config/*.automaton
535
	rm -f bin/why3config.byte bin/why3config.opt bin/why3config
536

537 538
local_config: bin/why3config.@OCAMLBEST@
	WHY3LIB=$(PWD) WHY3DATA=$(PWD)/share bin/why3config.@OCAMLBEST@ \
539
		--detect --conf_file why3.conf
540

541
install_no_local::
542
	cp -f bin/why3config.@OCAMLBEST@ $(BINDIR)/why3config$(EXE)
543

544
install_local: bin/why3config
545

MARCHE Claude's avatar
MARCHE Claude committed
546 547 548 549
###############
# IDE
###############

550 551
ifeq (@enable_ide@,yes)

François Bobot's avatar
François Bobot committed
552
IDE_FILES = gconfig gmain
MARCHE Claude's avatar
MARCHE Claude committed
553 554 555

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

Andrei Paskevich's avatar
Andrei Paskevich committed
556
IDEDEP = $(addsuffix .dep, $(IDEMODULES))
MARCHE Claude's avatar
MARCHE Claude committed
557 558 559
IDECMO = $(addsuffix .cmo, $(IDEMODULES))
IDECMX = $(addsuffix .cmx, $(IDEMODULES))

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

563
# build targets
MARCHE Claude's avatar
MARCHE Claude committed
564

565 566
byte: bin/why3ide.byte
opt:  bin/why3ide.opt
MARCHE Claude's avatar
MARCHE Claude committed
567

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

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

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

579 580 581
bin/why3ide: bin/why3ide.@OCAMLBEST@
	ln -sf why3ide.@OCAMLBEST@ $@

582
src/ide/resetgc.o: src/ide/resetgc.c
583
	$(OCAMLC) -c -ccopt "-Wall -o $@" $<
584

MARCHE Claude's avatar
MARCHE Claude committed
585 586
# depend and clean targets

Andrei Paskevich's avatar
Andrei Paskevich committed
587 588 589
ifneq "$(MAKECMDGOALS)" "clean"
include $(IDEDEP)
endif
MARCHE Claude's avatar
MARCHE Claude committed
590

Andrei Paskevich's avatar
Andrei Paskevich committed
591
depend: $(IDEDEP)
MARCHE Claude's avatar
MARCHE Claude committed
592 593

clean::
594
	rm -f src/ide/xml.ml
MARCHE Claude's avatar
MARCHE Claude committed
595
	rm -f src/ide/*.cm[iox] src/ide/*.o
Andrei Paskevich's avatar
Andrei Paskevich committed
596
	rm -f src/ide/*.annot src/ide/*.dep src/ide/*~
597
	rm -f bin/why3ide.byte bin/why3ide.opt bin/why3ide
MARCHE Claude's avatar
MARCHE Claude committed
598

599
install_no_local::
600
	cp -f bin/why3ide.@OCAMLBEST@ $(BINDIR)/why3ide$(EXE)
601 602

install_local: bin/why3ide
603

604
endif
MARCHE Claude's avatar
d  
MARCHE Claude committed
605

606

MARCHE Claude's avatar
MARCHE Claude committed
607 608 609 610
###############
# Replayer
###############

François Bobot's avatar
François Bobot committed
611
REPLAYER_FILES = replay
MARCHE Claude's avatar
MARCHE Claude committed
612

613
REPLAYERMODULES = $(addprefix src/why3replayer/, $(REPLAYER_FILES))
MARCHE Claude's avatar
MARCHE Claude committed
614

Andrei Paskevich's avatar
Andrei Paskevich committed
615
REPLAYERDEP = $(addsuffix .dep, $(REPLAYERMODULES))
MARCHE Claude's avatar
MARCHE Claude committed
616 617 618
REPLAYERCMO = $(addsuffix .cmo, $(REPLAYERMODULES))
REPLAYERCMX = $(addsuffix .cmx, $(REPLAYERMODULES))

619 620
$(REPLAYERDEP): DEPFLAGS += -I src/why3replayer
$(REPLAYERCMO) $(REPLAYERCMX): INCLUDES += -I src/why3replayer
MARCHE Claude's avatar
MARCHE Claude committed
621 622 623 624 625 626

# build targets

byte: bin/why3replayer.byte
opt:  bin/why3replayer.opt

627
bin/why3replayer.opt: lib/why3/why3.cmxa $(REPLAYERCMX)
Andrei Paskevich's avatar
Andrei Paskevich committed
628
	$(if $(QUIET),@echo 'Linking  $@' &&) \
629
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^
MARCHE Claude's avatar
MARCHE Claude committed
630

631
bin/why3replayer.byte: lib/why3/why3.cma $(REPLAYERCMO)
MARCHE Claude's avatar
MARCHE Claude committed
632
	$(if $(QUIET),@echo 'Linking  $@' &&) \
633
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^
MARCHE Claude's avatar
MARCHE Claude committed
634 635 636 637 638 639

bin/why3replayer: bin/why3replayer.@OCAMLBEST@
	ln -sf why3replayer.@OCAMLBEST@ $@

# depend and clean targets

Andrei Paskevich's avatar
Andrei Paskevich committed
640 641 642
ifneq "$(MAKECMDGOALS)" "clean"
include $(REPLAYERDEP)
endif
MARCHE Claude's avatar
MARCHE Claude committed
643

Andrei Paskevich's avatar
Andrei Paskevich committed
644
depend: $(REPLAYERDEP)
MARCHE Claude's avatar
MARCHE Claude committed
645 646

clean::
647 648
	rm -f src/why3replayer/*.cm[iox] src/why3replayer/*.o
	rm -f src/why3replayer/*.annot src/why3replayer/*.dep src/why3replayer/*~
MARCHE Claude's avatar
MARCHE Claude committed
649 650 651
	rm -f bin/why3replayer.byte bin/why3replayer.opt bin/why3replayer

install_no_local::
652
	cp -f bin/why3replayer.@OCAMLBEST@ $(BINDIR)/why3replayer$(EXE)
MARCHE Claude's avatar
MARCHE Claude committed
653 654 655

install_local: bin/why3replayer

656 657 658 659 660

###############
# Session
###############

661 662
SESSION_FILES = why3session_lib why3session_copy why3session_info	\
		why3session_latex why3session_html why3session_rm	\
663 664
		why3session_output why3session_run why3session_csv	\
		why3session
665 666 667

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

Andrei Paskevich's avatar
Andrei Paskevich committed
668
SESSIONDEP = $(addsuffix .dep, $(SESSIONMODULES))
669 670 671
SESSIONCMO = $(addsuffix .cmo, $(SESSIONMODULES))
SESSIONCMX = $(addsuffix .cmx, $(SESSIONMODULES))

Andrei Paskevich's avatar
Andrei Paskevich committed
672
$(SESSIONDEP): DEPFLAGS += -I src/why3session
673 674 675 676 677 678 679
$(SESSIONCMO) $(SESSIONCMX): INCLUDES += -I src/why3session

# build targets

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

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

684
bin/why3session.byte: lib/why3/why3.cma $(SESSIONCMO)
685
	$(if $(QUIET),@echo 'Linking  $@' &&) \
686
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^
687 688 689 690 691 692

bin/why3session: bin/why3session.@OCAMLBEST@
	ln -sf why3session.@OCAMLBEST@ $@

# depend and clean targets

Andrei Paskevich's avatar
Andrei Paskevich committed
693 694 695
ifneq "$(MAKECMDGOALS)" "clean"
include $(SESSIONDEP)
endif
696

Andrei Paskevich's avatar
Andrei Paskevich committed
697
depend: $(SESSIONDEP)
698 699

clean::
Andrei Paskevich's avatar
Andrei Paskevich committed
700 701
	rm -f src/why3session/*.cm[iox] src/why3session/*.o
	rm -f src/why3session/*.annot src/why3session/*.dep src/why3session/*~
702 703 704 705 706 707 708
	rm -f bin/why3session.byte bin/why3session.opt bin/why3session

install_no_local::
	cp -f bin/why3session.@OCAMLBEST@ $(BINDIR)/why3session$(EXE)

install_local: bin/why3session

MARCHE Claude's avatar
MARCHE Claude committed
709

710
###############
711
# Bench
712 713
###############

714 715
ifeq (@enable_bench@,yes)

716
BENCH_FILES = worker db bench benchrc benchdb why3bench
717

718
BENCHMODULES := $(addprefix src/why3bench/, $(BENCH_FILES))
719

Andrei Paskevich's avatar
Andrei Paskevich committed
720
BENCHDEP = $(addsuffix .dep, $(BENCHMODULES))
721 722 723
BENCHCMO = $(addsuffix .cmo, $(BENCHMODULES))
BENCHCMX = $(addsuffix .cmx, $(BENCHMODULES))

724 725
$(BENCHDEP): DEPFLAGS += -I src/why3bench
$(BENCHCMO) $(BENCHCMX): INCLUDES += -I src/why3bench -I @SQLITE3LIB@
726 727 728

# build targets

729 730
byte: bin/why3bench.byte
opt:  bin/why3bench.opt
731

Andrei Paskevich's avatar
Andrei Paskevich committed
732
bin/why3bench.opt bin/why3bench.byte: INCLUDES += -thread -I +threads -I @SQLITE3LIB@
733
bin/why3bench.opt bin/why3bench.byte: EXTLIBS += threads sqlite3
734

735
bin/why3bench.opt: lib/why3/why3.cmxa $(BENCHCMX)
Andrei Paskevich's avatar
Andrei Paskevich committed
736
	$(if $(QUIET),@echo 'Linking  $@' &&) \
737
	    $(OCAMLOPT) $(OFLAGS) -o $@ $(OLINKFLAGS) $^
738

739
bin/why3bench.byte: lib/why3/why3.cma $(BENCHCMO)
740
	$(if $(QUIET),@echo 'Linking  $@' &&) \
741
	    $(OCAMLC) $(BFLAGS) -o $@ $(BLINKFLAGS) $^
742

743 744 745
bin/why3bench: bin/why3bench.@OCAMLBEST@
	ln -sf why3bench.@OCAMLBEST@ $@

746 747
# depend and clean targets

Andrei Paskevich's avatar
Andrei Paskevich committed
748 749 750
ifneq "$(MAKECMDGOALS)" "clean"
include $(BENCHDEP)
endif
751

Andrei Paskevich's avatar
Andrei Paskevich committed
752
depend: $(BENCHDEP)
753 754

clean::
755 756
	rm -f src/why3bench/*.cm[iox] src/why3bench/*.o
	rm -f src/why3bench/*.annot src/why3bench/*.dep src/why3bench/*~
757
	rm -f bin/why3bench.byte bin/why3bench.opt bin/why3bench
758 759

install_no_local::
760
	cp -f bin/why3bench.@OCAMLBEST@ $(BINDIR)/why3bench$(EXE)
761 762

install_local: bin/why3bench
763

764 765
endif

766 767 768
##############
# Coq plugin
##############
769

Andrei Paskevich's avatar
Andrei Paskevich committed
770
ifeq (@enable_coq_tactic@,yes)
771

Claude Marche's avatar
Claude Marche committed
772
COQPGENERATED = src/coq-tactic/coqCompat.ml src/coq-tactic/g_why3tac.ml
773

Claude Marche's avatar
Claude Marche committed
774
COQP_FILES = coqCompat why3tac g_why3tac
775

776
COQPMODULES = $(addprefix src/coq-tactic/, $(COQP_FILES))
777

778 779 780
COQPDEP = $(addsuffix .dep, $(COQPMODULES))
COQPCMO = $(addsuffix .cmo, $(COQPMODULES))
COQPCMX = $(addsuffix .cmx, $(COQPMODULES))
781

782
COQPTREES = kernel lib interp parsing proofs pretyping tactics library toplevel
Andrei Paskevich's avatar
Andrei Paskevich committed
783
COQPINCLUDES = -I src/coq-tactic -I +camlp5 $(addprefix -I @COQLIB@/, $(COQPTREES))
784

785
$(COQPDEP): DEPFLAGS += -I src/coq-tactic
786
$(COQPCMO) $(COQPCMX): INCLUDES += $(COQPINCLUDES)
Andrei Paskevich's avatar
Andrei Paskevich committed
787 788
$(COQPCMO) $(COQPCMX): BFLAGS += -rectypes
$(COQPCMX): OFLAGS += -rectypes
789

790
$(COQPDEP): $(COQPGENERATED)
791