-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
2500 lines (2133 loc) · 85.4 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##########################################################################
# #
# This file is part of Frama-C. #
# #
# Copyright (C) 2007-2019 #
# CEA (Commissariat à l'énergie atomique et aux énergies #
# alternatives) #
# #
# you can redistribute it and/or modify it under the terms of the GNU #
# Lesser General Public License as published by the Free Software #
# Foundation, version 2.1. #
# #
# It is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU Lesser General Public License for more details. #
# #
# See the GNU Lesser General Public License version 2.1 #
# for more details (enclosed in the file licenses/LGPLv2.1). #
# #
##########################################################################
# This file is the main makefile of Frama-C.
FRAMAC_SRC=.
MAKECONFIG_DIR=share
PLUGIN_TESTS_LIST:=
include share/Makefile.common
include share/Makefile.dynamic_config.internal
#Check share/Makefile.config available
ifndef FRAMAC_ROOT_SRCDIR
$(error \
"You should run ./configure first (or autoconf if there is no configure)")
endif
###################
# Frama-C Version #
###################
VERSION:=$(shell $(CAT) VERSION)
VERSION_CODENAME:=$(shell $(CAT) VERSION_CODENAME)
###########################
# Global plugin variables #
###########################
# the directory where compiled plugin non-GUI files are stored
PLUGIN_TOP_LIB_DIR= $(PLUGIN_LIB_DIR)/top
# the directory where compiled plugin GUI files are stored
PLUGIN_GUI_LIB_DIR= $(PLUGIN_LIB_DIR)/gui
# the directory where the other Makefiles are
FRAMAC_SHARE = share
# Shared lists between Makefile.plugin and Makefile :
# initialized them as "simply extended variables" (with :=)
# for a correct behavior of += (see section 6.6 of GNU Make manual)
PLUGIN_LIST :=
PLUGIN_GENERATED_LIST:=
PLUGIN_CMO_LIST :=
PLUGIN_CMX_LIST :=
PLUGIN_META_LIST :=
PLUGIN_DYN_CMI_LIST :=
PLUGIN_DYN_CMO_LIST :=
PLUGIN_DYN_CMX_LIST :=
PLUGIN_INTERNAL_CMO_LIST:=
PLUGIN_INTERNAL_CMX_LIST:=
PLUGIN_GUI_CMO_LIST:=
PLUGIN_GUI_CMX_LIST:=
PLUGIN_DYN_DEP_GUI_CMO_LIST:=
PLUGIN_DYN_DEP_GUI_CMX_LIST:=
PLUGIN_DYN_GUI_CMO_LIST :=
PLUGIN_DYN_GUI_CMX_LIST :=
PLUGIN_TYPES_CMO_LIST :=
PLUGIN_TYPES_CMX_LIST :=
PLUGIN_DEP_LIST:=
PLUGIN_DOC_LIST :=
PLUGIN_DOC_DIRS :=
PLUGIN_DISTRIBUTED_LIST:=
PLUGIN_DIST_TARGET_LIST:=
PLUGIN_DIST_DOC_LIST:=
PLUGIN_BIN_DOC_LIST:=
PLUGIN_DIST_EXTERNAL_LIST:=
PLUGIN_DIST_TESTS_LIST:=
PLUGIN_DISTRIBUTED_NAME_LIST:=
MERLIN_PACKAGES:=
PLUGIN_HEADER_SPEC_LIST :=
PLUGIN_HEADER_DIRS_LIST :=
PLUGIN_HEADER_EXCEPTIONS_LIST :=
PLUGIN_CEA_PROPRIETARY_HEADERS_LIST :=
PLUGIN_CEA_PROPRIETARY_FILES_LIST :=
# default value used for HEADER_SPEC and PLUGIN_HEADER_SPEC
DEFAULT_HEADER_SPEC := headers/header_spec.txt
# default value used for HEADER_DIRS and PLUGIN_HEADER_DIRS
DEFAULT_HEADER_DIRS := headers
# default value used for HEADER_EXCEPTIONS and PLUGIN_HEADER_EXCEPTIONS
DEFAULT_HEADER_EXCEPTIONS := configure
# default value used for CEA_PROPRIETARY_FILES and PLUGIN_CEA_PROPRIETARY_FILES
DEFAULT_CEA_PROPRIETARY_FILES := tests/non-free/%
# default value used for CEA_PROPRIETARY_HEADERS
# and PLUGIN_CEA_PROPRIETARY_HEADERS
DEFAULT_CEA_PROPRIETARY_HEADERS := CEA_PROPRIETARY
MERLIN_PACKAGES:=
###############################
# Additional global variables #
###############################
# Directories containing some source code
SRC_DIRS= ptests $(PLUGIN_LIB_DIR) $(FRAMAC_SRC_DIRS)
# Directory containing source code documentation
DOC_DIR = doc/code
# Source files to document
MODULES_TODOC=
# Directories to include when compiling
INCLUDES=$(addprefix -I ,$(FRAMAC_SRC_DIRS)) -I $(PLUGIN_LIB_DIR)
ifneq ($(ENABLE_GUI),no)
GUI_INCLUDES = $(addprefix -package ,$(LIBRARY_NAMES_GUI))
else
GUI_INCLUDES =
endif
# Files for which dependencies must be computed.
# Other files are added later in this Makefile.
FILES_FOR_OCAMLDEP+=$(PLUGIN_LIB_DIR)/*.mli
BFLAGS = $(PACKAGES) $(FLAGS) $(DEBUG) $(INCLUDES) \
$(FRAMAC_USER_BFLAGS)
OFLAGS = $(PACKAGES) $(FLAGS) $(DEBUG) $(INCLUDES) -compact \
$(FRAMAC_USER_OFLAGS)
BLINKFLAGS += -linkpkg $(BFLAGS) -linkall -custom
OLINKFLAGS += -linkpkg $(OFLAGS) -linkall
DOC_FLAGS= -charset utf8 -colorize-code -stars -m A $(PACKAGES) $(INCLUDES) $(GUI_INCLUDES)
ifneq ($(VERBOSEMAKE),yes)
DOC_FLAGS+= -hide-warnings
endif
lib:
mkdir -p lib lib/gui lib/plugins
# Files that depend on external libraries -namely Zarith- whose interface
# has not been explicitely declared -opaque, hence would trigger warning 58.
# This can't be solved by Frama-C itself, we can only wait for an update of
# said library.
NON_OPAQUE_DEPS:=
# Libraries generated by Frama-C
GEN_BYTE_LIBS=
GEN_OPT_LIBS=
# Libraries used in Frama-C
EXTRA_OPT_LIBS:=
PACKAGES = $(addprefix -package ,$(LIBRARY_NAMES))
BYTE_LIBS = $(GEN_BYTE_LIBS)
OPT_LIBS = $(EXTRA_OPT_LIBS)
OPT_LIBS+= $(GEN_OPT_LIBS)
ICONS:= $(addprefix share/,\
frama-c.ico frama-c.png unmark.png \
switch-on.png switch-off.png )
THEME_ICON_NAMES:= \
never_tried.png \
unknown.png \
surely_valid.png \
surely_invalid.png \
considered_valid.png \
valid_under_hyp.png \
invalid_under_hyp.png \
invalid_but_dead.png \
unknown_but_dead.png \
valid_but_dead.png \
inconsistent.png \
fold.png unfold.png
THEME_ICONS_DEFAULT:= \
$(addprefix share/theme/default/,$(THEME_ICON_NAMES))
THEME_ICONS_COLORBLIND:= \
$(addprefix share/theme/colorblind/,$(THEME_ICON_NAMES))
THEME_ICONS_FLAT:= \
$(addprefix share/theme/flat/,$(THEME_ICON_NAMES))
ROOT_LIBC_DIR:= share/libc
LIBC_SUBDIRS:= sys netinet net arpa
LIBC_DIR:= $(ROOT_LIBC_DIR) $(addprefix $(ROOT_LIBC_DIR)/,$(LIBC_SUBDIRS))
LIBC_FILES:= \
$(wildcard share/*.h share/*.c) \
$(wildcard $(addsuffix /*.h,$(LIBC_DIR))) \
$(wildcard $(addsuffix /*.c,$(LIBC_DIR)))
# Checks that all .h can be included multiple times.
ALL_LIBC_HEADERS:=$(wildcard share/*.h $(addsuffix /*.h,$(LIBC_DIR)))
check-libc: bin/toplevel.$(OCAMLBEST)$(EXE)
@echo "checking libc..."; \
EXIT_VALUE=0; \
for file in $(filter-out share/builtin.h,$(ALL_LIBC_HEADERS)); do \
echo "#include \"$$file\"" > check-libc.c; \
echo "#include \"$$file\"" >> check-libc.c; \
FRAMAC_SHARE=share bin/toplevel.$(OCAMLBEST)$(EXE) \
-cpp-extra-args="-Ishare/libc -nostdinc" check-libc.c \
> $$(basename $$file .h).log 2>&1; \
if test $$? -ne 0; then \
if grep -q -e '#error "Frama-C:' $$file; then : ; \
else \
echo "$$file cannot be included twice. \
Output is in $$(basename $$file .h).log"; \
EXIT_VALUE=1; \
fi; \
else \
rm $$(basename $$file .h).log; \
fi; \
done; \
rm check-libc.c; \
exit $$EXIT_VALUE
clean-check-libc:
$(RM) *.log
# Kernel files to be included in the distribution.
# Plug-ins should use PLUGIN_DISTRIB_EXTERNAL if they export something else
# than *.ml* files in their directory.
# NB: configure for the distribution is generated in the distrib directory
# itself, rather than copied: otherwise, it could include references to
# non-distributed plug-ins.
DISTRIB_FILES:=\
$(wildcard bin/migration_scripts/*2*.sh) bin/local_export.sh \
bin/frama-c bin/frama-c.byte bin/frama-c-gui bin/frama-c-gui.byte \
bin/frama-c-config bin/frama-c-script \
share/frama-c.WIN32.rc share/frama-c.Unix.rc \
$(ICONS) $(THEME_ICONS_DEFAULT) $(THEME_ICONS_COLORBLIND) \
$(THEME_ICONS_FLAT) \
man/frama-c.1 doc/README \
doc/code/docgen.ml \
doc/code/*.css doc/code/intro_plugin.txt \
doc/code/intro_plugin_D_and_S.txt \
doc/code/intro_plugin_default.txt \
doc/code/intro_kernel_plugin.txt \
doc/code/toc_head.htm \
doc/code/toc_tail.htm \
doc/Makefile \
$(filter-out ptests/ptests_config.ml,$(wildcard ptests/*.ml*)) \
configure.in Makefile Makefile.generating \
Changelog config.h.in \
VERSION VERSION_CODENAME $(wildcard licenses/*) \
$(LIBC_FILES) \
share/analysis-scripts/benchmark_database.py \
share/analysis-scripts/cmd-dep.sh \
share/analysis-scripts/concat-csv.sh \
share/analysis-scripts/clone.sh \
$(wildcard share/analysis-scripts/examples/*) \
share/analysis-scripts/fc_stubs.c \
share/analysis-scripts/find_fun.py \
share/analysis-scripts/flamegraph.pl \
share/analysis-scripts/frama-c.mk \
share/analysis-scripts/frama_c_results.py \
share/analysis-scripts/git_utils.py \
share/analysis-scripts/list_files.py \
share/analysis-scripts/make_template.py \
share/analysis-scripts/make_wrapper.py \
share/analysis-scripts/parse-coverage.sh \
share/analysis-scripts/README.md \
share/analysis-scripts/results_display.py \
share/analysis-scripts/summary.py \
share/analysis-scripts/template.mk \
$(wildcard share/emacs/*.el) share/autocomplete_frama-c \
share/_frama-c \
share/compliance/c11_functions.json \
share/compliance/glibc_functions.json \
share/compliance/nonstandard_identifiers.json \
share/compliance/posix_identifiers.json \
share/configure.ac \
share/Makefile.config.in share/Makefile.common \
share/Makefile.generic \
share/Makefile.plugin.template share/Makefile.dynamic \
share/Makefile.dynamic_config.external \
share/Makefile.dynamic_config.internal \
share/META.frama-c \
$(filter-out src/kernel_internals/runtime/config.ml, \
$(wildcard src/kernel_internals/runtime/*.ml*)) \
$(wildcard src/kernel_services/abstract_interp/*.ml*) \
$(wildcard src/plugins/gui/*.ml*) \
$(wildcard src/libraries/stdlib/*.ml*) \
$(wildcard src/libraries/utils/*.ml*) \
$(wildcard src/libraries/utils/*.c) \
$(wildcard src/libraries/project/*.ml*) \
$(filter-out src/kernel_internals/parsing/check_logic_parser.ml, \
$(wildcard src/kernel_internals/parsing/*.ml*)) \
$(wildcard src/kernel_internals/typing/*.ml*) \
$(wildcard src/kernel_services/ast_data/*.ml*) \
$(wildcard src/kernel_services/ast_queries/*.ml*) \
$(wildcard src/kernel_services/ast_printing/*.ml*) \
$(wildcard src/kernel_services/cmdline_parameters/*.ml*) \
$(wildcard src/kernel_services/analysis/*.ml*) \
$(wildcard src/kernel_services/ast_transformations/*.ml*) \
$(wildcard src/kernel_services/plugin_entry_points/*.ml*) \
$(wildcard src/kernel_services/visitors/*.ml*) \
$(wildcard src/kernel_services/parsetree/*.ml*) \
$(wildcard src/libraries/datatype/*.ml*) \
bin/sed_get_make_major bin/sed_get_make_minor \
INSTALL.md README.md .make-clean \
.make-clean-stamp .force-reconfigure \
opam/opam opam/descr \
# Test files to be included in the distribution (without header checking).
# Plug-ins should use PLUGIN_DISTRIB_TESTS to export their test files.
DISTRIB_TESTS=$(shell git ls-files \
tests \
src/plugins/aorai/tests \
src/plugins/report/tests \
src/plugins/wp/tests)
# files that are needed to compile API documentation of external plugins
DOC_GEN_FILES:=$(addprefix doc/code/,\
*.css intro_plugin.txt intro_kernel_plugin.txt \
intro_plugin_default.txt intro_plugin_D_and_S \
kernel-doc.ocamldoc \
docgen.ml docgen.cm* *.htm)
################
# Main targets #
################
# additional compilation targets for 'make all'.
# cannot be delayed after 'make all'
EXTRAS = ptests bin/fc-config$(EXE)
ifneq ($(ENABLE_GUI),no)
ifeq ($(HAS_LABLGTK),yes)
EXTRAS += gui
endif
endif
all:: byte $(OCAMLBEST) $(EXTRAS) plugins_ptests_config
.PHONY: top opt byte dist bdist rebuild rebuild-branch
dist: clean
$(QUIET_MAKE) all
clean-rebuild: clean
$(QUIET_MAKE) all
rebuild: config.status
$(MAKE) smartclean
$(MAKE) depend $(FRAMAC_PARALLEL)
$(MAKE) all $(FRAMAC_PARALLEL) || \
(touch .force-reconfigure; \
$(MAKE) config.status && \
$(MAKE) depend $(FRAMAC_PARALLEL) && \
$(MAKE) all $(FRAMAC_PARALLEL))
sinclude .Makefile.user
# Should define FRAMAC_PARALLEL, FRAMAC_USER_FLAGS, FRAMAC_USER_MERLIN_FLAGS
#Create link in share for local execution if
.PHONY:create_share_link
create_share_link: share/.gitignore
# note: when using opam pin path in a cloned Frama-C git, the symbolic links
# become directories, so a different command is necessary for each situation
share/.gitignore: share/Makefile.config
if test -f $@; then \
for link in $$(cat $@); do \
if test -L share$$link; then \
rm -f share$$link \
else \
rm -rf share$$link; \
fi; \
done; \
fi
$(RM) [email protected]
touch [email protected]
$(foreach dir,$(EXTERNAL_PLUGINS),\
if test -d $(dir)/share; then \
echo "Sharing $(dir)/link"; \
ln -s $(realpath $(dir)/share) share/$(notdir $(dir)); \
echo /$(notdir $(dir)) >> [email protected]; \
fi; )
mv [email protected] $@
ifeq ("$(DEVELOPMENT)","yes")
all:: share/.gitignore
endif
clean_share_link:
if test -f share/.gitignore; then \
for link in $$(cat share/.gitignore); do \
if test -L share$$link; then \
rm -f share$$link \
else \
rm -rf share$$link; \
fi; \
done; \
rm share/.gitignore; \
fi
clean:: clean_share_link
##############
# Ocamlgraph #
##############
# dgraph (included in ocamlgraph)
#[LC] Cf https://github.com/backtracking/ocamlgraph/pull/32
ifeq ($(HAS_GNOMECANVAS),yes)
ifneq ($(ENABLE_GUI),no)
GRAPH_GUICMO= dgraph.cmo
GRAPH_GUICMX= dgraph.cmx
GRAPH_GUIO= dgraph.o
HAS_DGRAPH=yes
else # enable_gui is no: disable dgraph
HAS_DGRAPH=no
endif
else # gnome_canvas is not yes: disable dgraph
HAS_DGRAPH=no
endif
##################
# Frama-C Kernel #
##################
# Libraries which could be compiled fully independently
#######################################################
VERY_FIRST_CMO = src/kernel_internals/runtime/frama_c_init.cmo
CMO += $(VERY_FIRST_CMO)
LIB_CMO =\
src/libraries/stdlib/transitioning \
src/libraries/stdlib/FCSet \
src/libraries/stdlib/FCMap \
src/libraries/stdlib/FCBuffer \
src/libraries/stdlib/FCHashtbl \
src/libraries/stdlib/extlib \
src/libraries/datatype/unmarshal \
src/libraries/datatype/unmarshal_z \
src/libraries/datatype/structural_descr \
src/libraries/datatype/type \
src/libraries/datatype/descr \
src/libraries/utils/filepath \
src/libraries/utils/sanitizer \
src/libraries/utils/pretty_utils \
src/libraries/utils/hook \
src/libraries/utils/bag \
src/libraries/utils/wto \
src/libraries/utils/vector \
src/libraries/utils/indexer \
src/libraries/utils/rgmap \
src/libraries/utils/bitvector \
src/libraries/utils/qstack \
src/libraries/stdlib/integer \
src/libraries/utils/json \
src/libraries/utils/markdown \
src/libraries/utils/rich_text \
src/libraries/utils/dotgraph
NON_OPAQUE_DEPS+=\
src/libraries/datatype/unmarshal_z \
src/libraries/stdlib/integer
LIB_CMO:= $(addsuffix .cmo,$(LIB_CMO))
CMO += $(LIB_CMO)
# Very first files to be linked (most modules use them)
###############################
FIRST_CMO= src/kernel_internals/runtime/config \
src/kernel_internals/runtime/gui_init \
src/kernel_services/plugin_entry_points/log \
src/kernel_services/cmdline_parameters/cmdline \
src/libraries/project/project_skeleton \
src/libraries/datatype/datatype \
src/kernel_services/plugin_entry_points/journal
# project_skeleton requires log
# datatype requires project_skeleton
# rangemap requires datatype
FIRST_CMO:= $(addsuffix .cmo,$(FIRST_CMO))
CMO += $(FIRST_CMO)
#Project (Project_skeleton must be linked before Journal)
PROJECT_CMO= \
state \
state_dependency_graph \
state_topological \
state_selection \
project \
state_builder
PROJECT_CMO:= $(patsubst %,src/libraries/project/%.cmo,$(PROJECT_CMO))
CMO += $(PROJECT_CMO)
# kernel
########
KERNEL_CMO=\
src/libraries/utils/utf8_logic.cmo \
src/libraries/utils/binary_cache.cmo \
src/libraries/utils/hptmap.cmo \
src/libraries/utils/hptset.cmo \
src/libraries/utils/escape.cmo \
src/kernel_services/ast_queries/cil_datatype.cmo \
src/kernel_services/cmdline_parameters/typed_parameter.cmo \
src/kernel_services/plugin_entry_points/dynamic.cmo \
src/kernel_services/cmdline_parameters/parameter_category.cmo \
src/kernel_services/cmdline_parameters/parameter_customize.cmo \
src/kernel_services/cmdline_parameters/parameter_state.cmo \
src/kernel_services/cmdline_parameters/parameter_builder.cmo \
src/kernel_services/plugin_entry_points/plugin.cmo \
src/kernel_services/plugin_entry_points/kernel.cmo \
src/libraries/utils/unicode.cmo \
src/kernel_services/plugin_entry_points/emitter.cmo \
src/libraries/utils/floating_point.cmo \
src/libraries/utils/rangemap.cmo \
src/kernel_services/ast_printing/cil_types_debug.cmo \
src/kernel_services/ast_printing/printer_builder.cmo \
src/libraries/utils/cilconfig.cmo \
src/kernel_internals/typing/alpha.cmo \
src/kernel_services/ast_queries/cil_state_builder.cmo \
src/kernel_internals/runtime/machdeps.cmo \
src/kernel_services/ast_queries/cil_const.cmo \
src/kernel_services/ast_queries/logic_env.cmo \
src/kernel_services/ast_queries/logic_const.cmo \
src/kernel_services/visitors/visitor_behavior.cmo \
src/kernel_services/ast_queries/cil.cmo \
src/kernel_internals/parsing/errorloc.cmo \
src/kernel_services/ast_printing/cil_printer.cmo \
src/kernel_services/ast_printing/cil_descriptive_printer.cmo \
src/kernel_services/parsetree/cabs.cmo \
src/kernel_services/parsetree/cabshelper.cmo \
src/kernel_services/ast_printing/logic_print.cmo \
src/kernel_services/ast_queries/logic_utils.cmo \
src/kernel_internals/parsing/logic_parser.cmo \
src/kernel_internals/parsing/logic_lexer.cmo \
src/kernel_services/ast_queries/logic_typing.cmo \
src/kernel_services/ast_queries/ast_info.cmo \
src/kernel_services/ast_data/ast.cmo \
src/kernel_services/ast_printing/cprint.cmo \
src/kernel_services/visitors/cabsvisit.cmo \
src/kernel_internals/typing/cabs2cil.cmo \
src/kernel_services/ast_data/globals.cmo \
src/kernel_internals/typing/cfg.cmo \
src/kernel_services/ast_data/kernel_function.cmo \
src/kernel_services/ast_data/property.cmo \
src/kernel_services/ast_data/property_status.cmo \
src/kernel_services/ast_data/annotations.cmo \
src/kernel_services/ast_printing/printer.cmo \
src/kernel_internals/typing/logic_builtin.cmo \
src/kernel_services/ast_printing/cabs_debug.cmo \
src/kernel_internals/parsing/lexerhack.cmo \
src/kernel_internals/parsing/clexer.cmo \
src/kernel_internals/parsing/cparser.cmo \
src/kernel_internals/parsing/logic_preprocess.cmo \
src/kernel_internals/typing/mergecil.cmo \
src/kernel_internals/typing/rmtmps.cmo \
src/kernel_internals/typing/oneret.cmo \
src/kernel_internals/typing/frontc.cmo \
src/kernel_services/analysis/ordered_stmt.cmo \
src/kernel_services/analysis/wto_statement.cmo \
src/kernel_services/analysis/dataflows.cmo \
src/kernel_services/analysis/dataflow2.cmo \
src/kernel_services/analysis/stmts_graph.cmo \
src/kernel_services/analysis/dominators.cmo \
src/kernel_services/analysis/service_graph.cmo \
src/kernel_services/analysis/undefined_sequence.cmo \
src/kernel_services/analysis/interpreted_automata.cmo \
src/kernel_services/ast_data/alarms.cmo \
src/kernel_services/ast_printing/description.cmo \
src/kernel_services/abstract_interp/lattice_messages.cmo \
src/kernel_services/abstract_interp/abstract_interp.cmo \
src/kernel_services/abstract_interp/bottom.cmo \
src/kernel_services/abstract_interp/int_Base.cmo \
src/kernel_services/analysis/bit_utils.cmo \
src/kernel_services/abstract_interp/fc_float.cmo \
src/kernel_services/abstract_interp/float_interval.cmo \
src/kernel_services/abstract_interp/fval.cmo \
src/kernel_services/abstract_interp/ival.cmo \
src/kernel_services/abstract_interp/base.cmo \
src/kernel_services/abstract_interp/origin.cmo \
src/kernel_services/abstract_interp/map_lattice.cmo \
src/kernel_services/abstract_interp/tr_offset.cmo \
src/kernel_services/abstract_interp/offsetmap.cmo \
src/kernel_services/abstract_interp/int_Intervals.cmo \
src/kernel_services/abstract_interp/locations.cmo \
src/kernel_services/abstract_interp/lmap.cmo \
src/kernel_services/abstract_interp/lmap_bitwise.cmo \
src/kernel_services/visitors/visitor.cmo \
src/kernel_services/ast_data/statuses_by_call.cmo \
src/kernel_services/ast_queries/logic_lemma_functions.cmo \
src/kernel_services/ast_printing/printer_tag.cmo \
$(PLUGIN_TYPES_CMO_LIST) \
src/kernel_services/plugin_entry_points/db.cmo \
src/libraries/utils/command.cmo \
src/libraries/utils/task.cmo \
src/kernel_services/ast_queries/filecheck.cmo \
src/kernel_services/ast_queries/json_compilation_database.cmo \
src/kernel_services/ast_queries/file.cmo \
src/kernel_internals/typing/translate_lightweight.cmo \
src/kernel_internals/typing/allocates.cmo \
src/kernel_internals/typing/unroll_loops.cmo \
src/kernel_internals/typing/asm_contracts.cmo \
src/kernel_services/analysis/loop.cmo \
src/kernel_services/analysis/exn_flow.cmo \
src/kernel_services/analysis/destructors.cmo \
src/kernel_services/analysis/logic_interp.cmo \
src/kernel_internals/typing/infer_annotations.cmo \
src/kernel_services/ast_transformations/clone.cmo \
src/kernel_services/ast_transformations/filter.cmo \
src/kernel_services/ast_transformations/inline.cmo \
src/kernel_internals/runtime/special_hooks.cmo \
src/kernel_internals/runtime/messages.cmo
CMO += $(KERNEL_CMO)
MLI_ONLY+=\
src/libraries/utils/hptmap_sig.mli \
src/kernel_services/cmdline_parameters/parameter_sig.mli \
src/kernel_services/ast_data/cil_types.mli \
src/kernel_services/parsetree/logic_ptree.mli \
src/kernel_services/ast_printing/printer_api.mli \
src/kernel_services/abstract_interp/float_sig.mli \
src/kernel_services/abstract_interp/float_interval_sig.mli \
src/kernel_services/abstract_interp/lattice_type.mli \
src/kernel_services/abstract_interp/int_Intervals_sig.mli \
src/kernel_services/abstract_interp/offsetmap_lattice_with_isotropy.mli \
src/kernel_services/abstract_interp/offsetmap_sig.mli \
src/kernel_services/abstract_interp/lmap_sig.mli \
src/kernel_services/abstract_interp/offsetmap_bitwise_sig.mli
NO_MLI+= src/kernel_services/parsetree/cabs.mli \
src/kernel_internals/runtime/machdep_ppc_32.mli \
src/kernel_internals/runtime/machdep_x86_16.mli \
src/kernel_internals/runtime/machdep_x86_32.mli \
src/kernel_internals/runtime/machdep_x86_64.mli \
src/kernel_services/ast_printing/cabs_debug.mli \
src/kernel_internals/parsing/logic_lexer.mli \
src/kernel_internals/parsing/lexerhack.mli \
MODULES_NODOC+= src/kernel_internals/runtime/machdep_ppc_32.ml \
src/kernel_internals/runtime/machdep_x86_16.ml \
src/kernel_internals/runtime/machdep_x86_32.ml \
src/kernel_internals/runtime/machdep_x86_64.ml \
external/unmarshal_z.mli
GENERATED += $(addprefix src/kernel_internals/parsing/,\
clexer.ml cparser.ml cparser.mli \
logic_lexer.ml logic_parser.ml \
logic_parser.mli logic_preprocess.ml)
.PHONY: check-logic-parser-wildcard
check-logic-parser-wildcard:
cd src/kernel_internals/parsing && ocaml check_logic_parser.ml
NON_OPAQUE_DEPS+= src/kernel_services/plugin_entry_points/dynamic
# C Bindings
############
GEN_C_BINDINGS=src/libraries/utils/c_bindings.o
GEN_C_BINDINGS_FLAGS= -fPIC
GEN_BYTE_LIBS+= $(GEN_C_BINDINGS)
GEN_OPT_LIBS+= $(GEN_C_BINDINGS)
src/libraries/utils/c_bindings.o: src/libraries/utils/c_bindings.c
$(PRINT_CC) $@
$(CC) $(GEN_C_BINDINGS_FLAGS) -c -I$(call winpath,$(OCAMLLIB)) -O3 -Wall -o $@ $<
# Common startup module
# All link command should add it as last linked module and depend on it.
########################################################################
STARTUP_CMO=src/kernel_internals/runtime/boot.cmo
STARTUP_CMX=$(STARTUP_CMO:.cmo=.cmx)
# GUI modules
# See below for GUI compilation
##############################################################################
WTOOLKIT= \
wutil widget wbox wfile wpane wpalette wtext wtable
ifeq ("$(LABLGTK_VERSION)","3")
src/plugins/gui/GSourceView.ml: src/plugins/gui/GSourceView3.ml.in
$(CP) $< $@
$(CHMOD_RO) $@
src/plugins/gui/GSourceView.mli: src/plugins/gui/GSourceView3.mli.in
$(CP) $< $@
$(CHMOD_RO) $@
else
src/plugins/gui/GSourceView.ml: src/plugins/gui/GSourceView2.ml.in
$(CP) $< $@
$(CHMOD_RO) $@
src/plugins/gui/GSourceView.mli: src/plugins/gui/GSourceView2.mli.in
$(CP) $< $@
$(CHMOD_RO) $@
endif
SOURCEVIEWCOMPAT:=GSourceView
GENERATED+=src/plugins/gui/GSourceView.ml src/plugins/gui/GSourceView.mli \
src/plugins/gui/dgraph_helper.ml src/plugins/gui/gtk_compat.ml
ifeq ($(LABLGTK),lablgtk3)
src/plugins/gui/gtk_compat.ml: src/plugins/gui/gtk_compat.3.ml
$(CP) $< $@
$(CHMOD_RO) $@
else
src/plugins/gui/gtk_compat.ml: src/plugins/gui/gtk_compat.2.ml
$(CP) $< $@
$(CHMOD_RO) $@
endif
GENERATED+=src/plugins/gui/gtk_compat.ml
ifeq ($(HAS_DGRAPH),yes)
DGRAPHFILES:=debug_manager
src/plugins/gui/dgraph_helper.ml: src/plugins/gui/dgraph_helper.yes.ml
$(CP) $< $@
$(CHMOD_RO) $@
else
DGRAPHFILES:=
src/plugins/gui/dgraph_helper.ml: src/plugins/gui/dgraph_helper.no.ml
$(CP) $< $@
$(CHMOD_RO) $@
endif
SINGLE_GUI_CMO:= \
wutil_once \
gtk_compat \
$(WTOOLKIT) \
$(SOURCEVIEWCOMPAT) \
gui_parameters \
gtk_helper \
dgraph_helper \
gtk_form \
source_viewer pretty_source source_manager book_manager \
warning_manager \
filetree \
launcher \
menu_manager \
history \
gui_printers \
design \
analyses_manager file_manager project_manager \
help_manager \
$(DGRAPHFILES) \
property_navigator \
SINGLE_GUI_CMO:= $(patsubst %,src/plugins/gui/%.cmo,$(SINGLE_GUI_CMO))
###############################################################################
# #
#################### #
# Plug-in sections # #
#################### #
# #
# For 'internal' developers: #
# you can add your own plug-in here, #
# but it is better to have your own separated Makefile #
###############################################################################
###########
# Metrics #
###########
PLUGIN_ENABLE:=$(ENABLE_METRICS)
PLUGIN_NAME:=Metrics
PLUGIN_DISTRIBUTED:=yes
PLUGIN_DIR:=src/plugins/metrics
PLUGIN_CMO:= metrics_parameters css_html metrics_base metrics_acsl \
metrics_cabs metrics_cilast metrics_coverage \
register
PLUGIN_GUI_CMO:= metrics_gui register_gui
PLUGIN_DEPENDENCIES:=Eva
PLUGIN_INTERNAL_TEST:=yes
$(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME)))
#############
# Callgraph #
#############
PLUGIN_ENABLE:=$(ENABLE_CALLGRAPH)
PLUGIN_NAME:=Callgraph
PLUGIN_DISTRIBUTED:=yes
PLUGIN_DIR:=src/plugins/callgraph
PLUGIN_CMO:= options journalize subgraph cg services uses register
ifeq ($(HAS_DGRAPH),yes)
PLUGIN_GUI_CMO:=cg_viewer
else
PLUGIN_GUI_CMO:=
PLUGIN_DISTRIB_EXTERNAL:=cg_viewer.ml
endif
PLUGIN_CMI:= callgraph_api
PLUGIN_INTERNAL_TEST:=yes
PLUGIN_TESTS_DIRS:=callgraph
PLUGIN_TESTS_LIB:=tests/callgraph/function_pointer.ml
$(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME)))
##################
# Evolved Value Analysis #
##################
PLUGIN_ENABLE:=$(ENABLE_EVA)
PLUGIN_NAME:=Eva
PLUGIN_DIR:=src/plugins/value
PLUGIN_EXTRA_DIRS:=engine values domains domains/cvalue domains/apron \
domains/gauges domains/equality legacy partitioning utils gui_files \
values/numerors domains/numerors
PLUGIN_TESTS_DIRS+=value/traces
# Files for the binding to Apron domains. Only available if Apron is available.
ifeq ($(HAS_APRON),yes)
PLUGIN_REQUIRES+= apron.octMPQ apron.boxMPQ apron.polkaMPQ apron.apron gmp
APRON_CMO:= domains/apron/apron_domain
else
APRON_CMO:=
PLUGIN_DISTRIB_EXTERNAL+= \
domains/apron/apron_domain.ml domains/apron/apron_domain.mli
endif
# Files for the numerors domain. Only available is MPFR is available.
NUMERORS_FILES:= \
values/numerors/numerors_utils values/numerors/numerors_float \
values/numerors/numerors_interval values/numerors/numerors_arithmetics \
values/numerors/numerors_value domains/numerors/numerors_domain
ifeq ($(HAS_MPFR),yes)
PLUGIN_REQUIRES+= gmp
PLUGIN_TESTS_DIRS+=value/numerors
NUMERORS_CMO:= $(NUMERORS_FILES)
else
# Do not compile numerors files, but include them in the distributed files.
NUMERORS_CMO:=
PLUGIN_DISTRIB_EXTERNAL+= $(addsuffix .ml,$(NUMERORS_FILES))
PLUGIN_DISTRIB_EXTERNAL+= $(addsuffix .mli,$(NUMERORS_FILES))
endif
# General rules for ordering files within PLUGIN_CMO:
# - try to keep the legacy Value before Eva
PLUGIN_CMO:= partitioning/split_strategy value_parameters \
utils/value_perf utils/value_util utils/red_statuses \
utils/mark_noresults \
utils/widen_hints_ext utils/widen utils/partitioning_annots \
partitioning/split_return \
partitioning/per_stmt_slevel \
utils/library_functions \
utils/eval_typ utils/backward_formals \
alarmset eval utils/structure utils/abstract \
values/value_product values/location_lift \
values/cvalue_forward values/cvalue_backward \
values/main_values values/main_locations \
values/offsm_value values/sign_value \
legacy/eval_op legacy/function_args \
domains/domain_store domains/domain_builder \
domains/domain_product domains/domain_lift domains/unit_domain \
domains/printer_domain \
domains/traces_domain \
domains/simple_memory \
domains/octagons \
domains/gauges/gauges_domain \
domains/hcexprs \
domains/equality/equality domains/equality/equality_domain \
domains/offsm_domain \
domains/symbolic_locs\
domains/sign_domain \
domains/cvalue/warn domains/cvalue/locals_scoping \
domains/cvalue/cvalue_offsetmap \
utils/value_results \
domains/cvalue/builtins domains/cvalue/builtins_malloc \
domains/cvalue/builtins_string domains/cvalue/builtins_misc \
domains/cvalue/builtins_memory domains/cvalue/builtins_print_c \
domains/cvalue/builtins_watchpoint \
domains/cvalue/builtins_float domains/cvalue/builtins_split \
domains/inout_domain \
utils/state_import \
legacy/eval_terms legacy/eval_annots \
domains/powerset engine/transfer_logic \
domains/cvalue/cvalue_transfer domains/cvalue/cvalue_init \
domains/cvalue/cvalue_specification \
domains/cvalue/cvalue_domain \
engine/subdivided_evaluation engine/evaluation engine/abstractions \
engine/recursion engine/transfer_stmt engine/transfer_specification \
partitioning/auto_loop_unroll \
partitioning/partition partitioning/partitioning_parameters \
partitioning/partitioning_index partitioning/trace_partitioning \
engine/mem_exec engine/iterator engine/initialization \
engine/compute_functions engine/analysis register \
$(APRON_CMO) $(NUMERORS_CMO)
PLUGIN_CMI:= values/abstract_value values/abstract_location \
domains/abstract_domain domains/simpler_domains
PLUGIN_DEPENDENCIES:=Callgraph LoopAnalysis RteGen
# These files are used by the GUI, but do not depend on Lablgtk
VALUE_GUI_AUX:=gui_files/gui_types gui_files/gui_eval \
gui_files/gui_callstacks_filters
PLUGIN_GUI_CMO:=$(VALUE_GUI_AUX) gui_files/gui_callstacks_manager \
gui_files/gui_red gui_files/register_gui
PLUGIN_INTERNAL_TEST:= yes
PLUGIN_TESTS_LIB=tests/float/fval_test.ml
PLUGIN_DISTRIBUTED:=yes
VALUE_TYPES:=$(addprefix src/plugins/value_types/,\
cilE cvalue precise_locs value_types widen_type)
PLUGIN_TYPES_CMO:=$(VALUE_TYPES)
PLUGIN_TYPES_TODOC:=$(addsuffix .mli,$(VALUE_TYPES))
$(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME)))
##################
# Occurrence #
##################
PLUGIN_ENABLE:=$(ENABLE_OCCURRENCE)
PLUGIN_NAME:=Occurrence
PLUGIN_DISTRIBUTED:=yes
PLUGIN_DIR:=src/plugins/occurrence
PLUGIN_CMO:= options register
PLUGIN_GUI_CMO:=register_gui
PLUGIN_INTRO:=doc/code/intro_occurrence.txt
PLUGIN_INTERNAL_TEST:=yes
PLUGIN_DEPENDENCIES:=Eva
$(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME)))
################################################
# Runtime Error Annotation Generation analysis #
################################################
PLUGIN_ENABLE:=$(ENABLE_RTEGEN)
PLUGIN_NAME:=RteGen
PLUGIN_DIR:=src/plugins/rte
PLUGIN_CMO:= options generator rte flags visit register
PLUGIN_DISTRIBUTED:=yes
PLUGIN_INTERNAL_TEST:=yes
PLUGIN_TESTS_DIRS:=rte rte_manual
PLUGIN_TESTS_LIB:=\
tests/rte/my_annotation/my_annotation.ml \
tests/rte/rte_api/rte_get_annot.ml \
tests/rte/compute_annot/compute_annot.ml \
tests/rte/my_annot_proxy/my_annot_proxy.ml
$(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME)))
#################
# From analysis #
#################
PLUGIN_ENABLE:=$(ENABLE_FROM_ANALYSIS)
PLUGIN_NAME:=From
PLUGIN_DIR:=src/plugins/from
PLUGIN_CMO:= from_parameters from_compute \
functionwise callwise from_register
PLUGIN_GUI_CMO:=from_register_gui
PLUGIN_TESTS_DIRS:=idct test float
PLUGIN_DISTRIBUTED:=yes
PLUGIN_INTERNAL_TEST:=yes
FROM_TYPES:=src/plugins/value_types/function_Froms
PLUGIN_TYPES_CMO:=$(FROM_TYPES)
PLUGIN_TYPES_TODOC:=$(addsuffix .mli,$(FROM_TYPES))
PLUGIN_DEPENDENCIES:=Callgraph Eva Postdominators
$(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME)))
##################
# Users analysis #
##################
PLUGIN_ENABLE:=$(ENABLE_USERS)
PLUGIN_NAME:=Users
PLUGIN_DIR:=src/plugins/users
PLUGIN_CMO:= users_register
PLUGIN_NO_TEST:=yes
PLUGIN_DISTRIBUTED:=yes
PLUGIN_INTERNAL_TEST:=yes
PLUGIN_DEPENDENCIES:=Callgraph Eva
$(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME)))
########################
# Constant propagation #
########################