-
Notifications
You must be signed in to change notification settings - Fork 76
/
dune
886 lines (834 loc) · 22.2 KB
/
dune
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
;**************************************************************************
;* *
;* OCaml *
;* *
;* Thomas Refis and Mark Shinwell, Jane Street Europe *
;* *
;* Copyright 2018--2020 Jane Street Group LLC *
;* *
;* All rights reserved. This file is distributed under the terms of *
;* the GNU Lesser General Public License version 2.1, with the *
;* special exception on linking described in the file LICENSE. *
;* *
;**************************************************************************
; set warning as error in release profile
(env
(release
(flags
(:standard -principal -w +a-4-9-40-41-42-44-45-48-66-67-70)))
(main
(flags
(:standard -principal -warn-error +A -w +a-4-9-40-41-42-44-45-48-66-67-70)))
(dev
(flags
(:standard -principal -w +a-4-9-40-41-42-44-45-48-66-67-70 -warn-error +A))))
(include dune.runtime_selection)
(copy_files# utils/*.ml{,i})
(copy_files# parsing/*.ml{,i})
(copy_files parsing/parser.mly)
(copy_files# typing/*.ml{,i})
(copy_files# bytecomp/*.ml{,i})
(copy_files# driver/*.ml{,i})
(copy_files# asmcomp/*.ml{,i})
(copy_files# backend/*.ml{,i})
(copy_files# backend/cfg/*.ml{,i})
(copy_files# backend/debug/*.ml{,i})
(copy_files# backend/debug/dwarf/dwarf_ocaml/*.ml{,i})
(copy_files# backend/internal_assembler/*.ml{,i})
(copy_files# backend/peephole/*.ml{,i})
(copy_files# backend/regalloc/*.ml{,i})
(copy_files# file_formats/*.ml{,i})
(copy_files# lambda/*.ml{,i})
(copy_files# middle_end/*.ml{,i})
(copy_files# printer/*.ml{,i})
(menhir
(modules parser)
(flags
--lalr
--explain
--dump
--require-aliases
--strict
--unused-token
COMMENT
--unused-token
DOCSTRING
--unused-token
EOL
--unused-token
GREATERRBRACKET
--table
--fixed-exception
--strategy
simplified
--cmly
--inspection))
(library
(name ocamlcommon)
(wrapped false)
(flags
(:standard
-strict-sequence
-bin-annot
-safe-string
-strict-formats
-w
-67
; remove -w -67 by adding the camlinternalMenhirLib hack like the Makefile
))
(ocamlopt_flags
(:include %{project_root}/ocamlopt_flags.sexp))
(preprocess
(per_module
((action
(progn
(echo "module MenhirLib = CamlinternalMenhirLib")
(run cat %{input-file})))
parser)))
(library_flags -linkall)
(libraries flambda2_floats)
(modules_without_implementation
annot
value_rec_types
asttypes
cmo_format
outcometree
parsetree
debug_event
solver_intf
mode_intf)
(modules
;; UTILS
config
build_path_prefix_map
misc
identifiable
numbers
arg_helper
clflags
debug
profile
profile_counters_functions
terminfo
ccomp
warnings
consistbl
strongly_connected_components
targetint
load_path
int_replace_polymorphic_compare
domainstate
binutils
local_store
target_system
compilation_unit
import_info
linkage_name
symbol
lazy_backtrack
diffing
diffing_with_keys
unit_info
language_extension_kernel
language_extension
zero_alloc_utils
zero_alloc_annotations
;; PARSING
location
longident
docstrings
printast
syntaxerr
ast_helper
camlinternalMenhirLib
ast_iterator
parser
lexer
parse
pprintast
ast_mapper
attr_helper
builtin_attributes
ast_invariants
depend
parser_types ; manual update: mli only files asttypes parsetree
;; TYPING
ident
path
jkind
primitive
shape
shape_reduce
zero_alloc
types
btype
oprint
subst
predef
datarepr
global_module
cmi_format
persistent_env
env
errortrace
mode
jkind_types
jkind_intf
signature_with_global_bindings
typedtree
printtyped
ctype
printtyp
includeclass
mtype
envaux
includecore
tast_iterator
tast_mapper
signature_group
cmt_format
cms_format
untypeast
includemod
includemod_errorprinter
typemode
jkind_axis
typetexp
patterns
printpat
parmatch
stypes
typedecl
typeopt
value_rec_check
typecore
solver_intf
solver
mode_intf
mode
uniqueness_analysis
typeclass
typemod
typedecl_variance
typedecl_properties
typedecl_separability
cmt2annot
; manual update: mli only files
annot
outcometree
allowance
;; lambda/
debuginfo
lambda
matching
printlambda
runtimedef
runtimetags
tmc
simplif
switch
value_rec_compiler
translmode
transl_comprehension_utils
transl_array_comprehension
transl_list_comprehension
translattribute
translclass
translcore
translmod
translobj
translprim
;; bytecomp/
debug_event
meta
opcodes
bytesections
dll
symtable
;; some of COMP
pparse
main_args
compenv
compmisc
makedepend
compile_common
; manual update: mli only files
annot
value_rec_types
asttypes
cmo_format
outcometree
parsetree
debug_event))
(library
(name ocamlbytecomp)
(wrapped false)
(flags
(:standard -strict-sequence -w +67 -bin-annot -safe-string -strict-formats))
(ocamlopt_flags
(:include %{project_root}/ocamlopt_flags.sexp))
(libraries ocamlcommon)
(modules
;; bytecomp/
bytegen
bytelibrarian
bytelink
bytepackager
emitcode
printinstr
instruct
;; driver/
errors
compile
maindriver))
(executable
(name main)
(modes byte)
(flags
(:standard -strict-sequence -w +67 -bin-annot -safe-string -strict-formats))
(libraries ocamlbytecomp ocamlcommon)
(modules main))
(executable
(name main_native)
(modes native)
(flags
(:standard -strict-sequence -w +67 -bin-annot -safe-string -strict-formats))
(libraries ocamlbytecomp ocamlcommon)
(modules main_native))
; Disabled since there can be only one (data_only_dirs) declaration
;(data_only_dirs yacc)
(include duneconf/dirs-to-ignore.inc)
(include duneconf/jst-extra.inc)
(rule
(deps
Makefile.build_config
Makefile.config_if_required
Makefile.common
(source_tree yacc))
(targets ocamlyacc)
(action
(no-infer
(progn
(chdir
yacc
(run make -s OCAMLYACC_INCLUDE_PATH=%{ocaml_where}))
(copy yacc/ocamlyacc ocamlyacc)))))
(install
(files ocamlyacc)
(section bin)
(package ocaml))
(alias
(name world)
(deps
ocamlc_byte.bc
debugger/ocamldebug.byte
ocamldoc/ocamldoc.byte
ocamltest/ocamltest.byte
toplevel/byte
toplevel/expunge.exe))
(install
(files
(main.bc as ocamlc.byte)
(main_native.exe as ocamlc.opt))
(section bin)
(package ocaml))
; For the moment we don't install optmain.{cmo,cmx,o} and opttopstart.{cmx,o}.
; When built with Dune, these have the "dune exe" module prefixes, so won't
; be named as a client would expect. There should also be a patch upstream
; now that moves the content of these files e.g. optmain -> optmaindriver,
; the latter being normal library files, which would not suffer from this
; "dune exe" prefix problem.
(install
(files
(ocamlbytecomp.a as compiler-libs/ocamlbytecomp.a)
(ocamlcommon.a as compiler-libs/ocamlcommon.a)
(ocamlbytecomp.cmxa as compiler-libs/ocamlbytecomp.cmxa)
(ocamlcommon.cmxa as compiler-libs/ocamlcommon.cmxa)
(ocamlbytecomp.cma as compiler-libs/ocamlbytecomp.cma)
(ocamlcommon.cma as compiler-libs/ocamlcommon.cma))
(section lib)
(package ocaml))
(install
(files
Makefile.build_config
Makefile.config_if_required
Makefile.config
VERSION)
(section lib)
(package ocaml))
(library
(name ocamloptcomp)
(wrapped false) ; for compatibility with existing code
(modes byte native)
; We should change the code so this "-open" can be removed.
; Likewise fix occurrences of warnings 9, 27, 32, 33, 34, 37, 39, and 60.
(flags
(:standard -w -27-32-33-34-37-39-60-69-70))
(ocamlopt_flags
(:include %{project_root}/ocamlopt_flags.sexp))
(instrumentation
(backend bisect_ppx))
(modules_without_implementation
branch_relaxation_intf
cmx_format
cmxs_format
x86_ast)
(modules
;; To match the Makefiles, ocamloptcomp needs to include ocamlmiddleend.
;; file_formats/
cmx_format
cmxs_format
;; middle_end/
backend_var
compilenv
;; asmcomp/
asmgen
asmlibrarian
asmlink
asmpackager
;; backend/
afl_instrument
arch
branch_relaxation
branch_relaxation_intf
cfg_selectgen
cfg_selection
cfgize
cmm_helpers
cmm_builtins
cmm_invariants
cmm
cmmgen_state
coloring
comballoc
CSE
CSE_utils
CSEgen
dataflow
deadcode
emit
emitaux
fdo_info
generic_fns
interf
interval
linear
internal_assembler
linscan
liveness
mach
peephole_optimize
peephole_rules
peephole_utils
polling
printcmm
printlinear
printmach
printreg
proc
simd
simd_selection
simd_reload
simd_proc
simple_operation
stack_check
reg
reload
reloadgen
relocation_entry
relocation_table
section_table
select_utils
selectgen
selection
selection_utils
spill
split
string_table
symbol_entry
symbol_table
x86_ast
x86_binary_emitter
x86_dsl
x86_gas
x86_masm
x86_proc
zero_alloc_checker
zero_alloc_info
;; backend/cfg
cfg
cfg_available_regs
cfg_intf
cfg_to_linear
cfg_with_layout
cfg_with_infos
cfg_comballoc
cfg_dataflow
cfg_deadcode
cfg_liveness
cfg_dominators
cfg_loop_infos
cfg_to_linear_desc
cfg_cse
cfg_stack_checks
cfg_polling
eliminate_dead_code
disconnect_block
eliminate_dead_blocks
eliminate_fallthrough_blocks
merge_straightline_blocks
extra_debug
label
linear_utils
simplify_terminator
vectorize
;; backend/regalloc
regalloc_gi
regalloc_gi_state
regalloc_gi_utils
regalloc_invariants
regalloc_irc
regalloc_irc_state
regalloc_irc_utils
regalloc_ls
regalloc_ls_state
regalloc_ls_utils
regalloc_rewrite
regalloc_split
regalloc_split_state
regalloc_split_utils
regalloc_stack_operands
regalloc_stack_slots
regalloc_utils
regalloc_validate
;; file_formats/
linear_format
cfg_format
;; backend/debug/
available_ranges_vars
available_regs
compute_ranges
compute_ranges_intf
inlined_frame_ranges
is_parameter
reg_availability_set
reg_with_debug_info
stack_reg_offset
;; backend/debug/dwarf/dwarf_ocaml
;; This code has a lot of dependencies into ocamloptcomp, so we just
;; build it as part of that library.
dwarf
dwarf_abstract_instances
dwarf_compilation_unit
dwarf_concrete_instances
dwarf_inlined_frames
dwarf_name_laundry
dwarf_reg_locations
dwarf_state
dwarf_variables_and_parameters
;; driver/
opterrors
optcompile
optmaindriver
compiler_hooks
;; printer/
printast_with_mappings
location_tracker_formatter
; The driver should be in here too, but is not at present. This might
; be tricky because it has a different name...
)
(libraries
ocamlcommon
flambda_backend_common
flambda_backend_utils
flambda2_identifiers
flambda2_cmx
compiler_owee
gc_timings
dwarf_low
dwarf_high))
(library
(name flambda_backend_common)
(wrapped false)
(modes byte native)
; same flags as for ocamlcommon library
(flags
(-strict-sequence
-bin-annot
-safe-string
-strict-formats
-w
-67
; remove -w -67 by adding the camlinternalMenhirLib hack like the Makefile
))
(ocamlopt_flags
(:include %{project_root}/ocamlopt_flags.sexp))
(instrumentation
(backend bisect_ppx))
(libraries ocamlcommon dwarf_flags asm_targets)
(modules flambda_backend_args flambda_backend_flags))
(executable
(name flambda_backend_main)
(modes byte)
(instrumentation
(backend bisect_ppx))
(libraries
flambda_backend_driver
memtrace
flambda2
flambda2_ui
flambda2_to_cmm
ocamloptcomp
ocamlcommon
unix)
(modules flambda_backend_main))
(rule
(targets flambda_backend_main_native.ml)
(action
(copy driver/flambda_backend_main.ml %{targets})))
(executable
(name flambda_backend_main_native)
(modes native)
(instrumentation
(backend bisect_ppx))
(ocamlopt_flags
(:standard -runtime-variant nnp))
(libraries
flambda_backend_driver
memtrace
flambda2
flambda2_ui
flambda2_to_cmm
ocamloptcomp
ocamlcommon
unix)
(modules flambda_backend_main_native))
; CR sdolan: Could be faster if it was closure-only?
(executable
(name boot_ocamlopt)
(modes native)
(instrumentation
(backend bisect_ppx))
; We don't use [unix] in [libraries] as that causes ocaml/otherlibs/unix/
; to be built against the system compiler, which won't work.
(ocamlc_flags unix.cma)
(ocamlopt_flags unix.cmxa)
(libraries
flambda_backend_driver
flambda2
flambda2_ui
flambda2_to_cmm
ocamloptcomp
ocamlcommon)
(modules boot_ocamlopt))
; The input archives (.a, .cma and .cmxa) to the following three rules
; must be kept in sync with each other and in a topological order.
(rule
(targets ocamloptcomp_with_flambda2.a)
(action
(run
%{dep:tools/merge_dot_a_files.sh}
%{targets}
%{dep:backend/debug/dwarf/dwarf_flags/dwarf_flags.a}
%{dep:backend/asm_targets/asm_targets.a}
%{dep:backend/debug/dwarf/dwarf_low/dwarf_low.a}
%{dep:backend/debug/dwarf/dwarf_high/dwarf_high.a}
%{dep:flambda_backend_common.a}
%{dep:utils/flambda_backend_utils.a}
%{dep:middle_end/flambda2/import/flambda2_import.a}
%{dep:middle_end/flambda2/ui/flambda2_ui.a}
%{dep:middle_end/flambda2/algorithms/flambda2_algorithms.a}
%{dep:middle_end/flambda2/numbers/floats/flambda2_floats.a}
%{dep:middle_end/flambda2/numbers/flambda2_numbers.a}
%{dep:middle_end/flambda2/kinds/flambda2_kinds.a}
%{dep:middle_end/flambda2/identifiers/flambda2_identifiers.a}
%{dep:middle_end/flambda2/nominal/flambda2_nominal.a}
%{dep:middle_end/flambda2/lattices/flambda2_lattices.a}
%{dep:middle_end/flambda2/bound_identifiers/flambda2_bound_identifiers.a}
%{dep:middle_end/flambda2/term_basics/flambda2_term_basics.a}
%{dep:middle_end/flambda2/classic_mode_types/flambda2_classic_mode_types.a}
%{dep:middle_end/flambda2/types/flambda2_types.a}
%{dep:middle_end/flambda2/terms/flambda2_terms.a}
%{dep:middle_end/flambda2/simplify_shared/flambda2_simplify_shared.a}
%{dep:middle_end/flambda2/cmx/flambda2_cmx.a}
%{dep:middle_end/flambda2/from_lambda/flambda2_from_lambda.a}
%{dep:middle_end/flambda2/simplify/flambda2_simplify.a}
%{dep:middle_end/flambda2/reaper/flambda2_reaper.a}
%{dep:middle_end/flambda2/parser/flambda2_parser.a}
%{dep:external/owee/compiler_owee.a}
%{dep:external/gc-timings/gc_timings.a}
%{dep:ocamloptcomp.a}
%{dep:middle_end/flambda2/to_cmm/flambda2_to_cmm.a}
%{dep:middle_end/flambda2/flambda2.a})))
(rule
(targets ocamloptcomp_with_flambda2.cma)
(action
(run
%{dep:tools/merge_archives.exe}
%{targets}
%{dep:backend/debug/dwarf/dwarf_flags/dwarf_flags.cma}
%{dep:backend/asm_targets/asm_targets.cma}
%{dep:backend/debug/dwarf/dwarf_low/dwarf_low.cma}
%{dep:backend/debug/dwarf/dwarf_high/dwarf_high.cma}
%{dep:flambda_backend_common.cma}
%{dep:utils/flambda_backend_utils.cma}
%{dep:middle_end/flambda2/import/flambda2_import.cma}
%{dep:middle_end/flambda2/ui/flambda2_ui.cma}
%{dep:middle_end/flambda2/algorithms/flambda2_algorithms.cma}
%{dep:middle_end/flambda2/numbers/floats/flambda2_floats.cma}
%{dep:middle_end/flambda2/numbers/flambda2_numbers.cma}
%{dep:middle_end/flambda2/kinds/flambda2_kinds.cma}
%{dep:middle_end/flambda2/identifiers/flambda2_identifiers.cma}
%{dep:middle_end/flambda2/nominal/flambda2_nominal.cma}
%{dep:middle_end/flambda2/lattices/flambda2_lattices.cma}
%{dep:middle_end/flambda2/bound_identifiers/flambda2_bound_identifiers.cma}
%{dep:middle_end/flambda2/term_basics/flambda2_term_basics.cma}
%{dep:middle_end/flambda2/classic_mode_types/flambda2_classic_mode_types.cma}
%{dep:middle_end/flambda2/types/flambda2_types.cma}
%{dep:middle_end/flambda2/terms/flambda2_terms.cma}
%{dep:middle_end/flambda2/simplify_shared/flambda2_simplify_shared.cma}
%{dep:middle_end/flambda2/cmx/flambda2_cmx.cma}
%{dep:middle_end/flambda2/from_lambda/flambda2_from_lambda.cma}
%{dep:middle_end/flambda2/simplify/flambda2_simplify.cma}
%{dep:middle_end/flambda2/reaper/flambda2_reaper.cma}
%{dep:middle_end/flambda2/parser/flambda2_parser.cma}
%{dep:external/owee/compiler_owee.cma}
%{dep:external/gc-timings/gc_timings.cma}
%{dep:ocamloptcomp.cma}
%{dep:middle_end/flambda2/to_cmm/flambda2_to_cmm.cma}
%{dep:middle_end/flambda2/flambda2.cma})))
(rule
(targets ocamloptcomp_with_flambda2.cmxa)
(action
(run
%{dep:tools/merge_archives.exe}
%{targets}
%{dep:backend/debug/dwarf/dwarf_flags/dwarf_flags.cmxa}
%{dep:backend/asm_targets/asm_targets.cmxa}
%{dep:backend/debug/dwarf/dwarf_low/dwarf_low.cmxa}
%{dep:backend/debug/dwarf/dwarf_high/dwarf_high.cmxa}
%{dep:flambda_backend_common.cmxa}
%{dep:utils/flambda_backend_utils.cmxa}
%{dep:middle_end/flambda2/import/flambda2_import.cmxa}
%{dep:middle_end/flambda2/ui/flambda2_ui.cmxa}
%{dep:middle_end/flambda2/algorithms/flambda2_algorithms.cmxa}
%{dep:middle_end/flambda2/numbers/floats/flambda2_floats.cmxa}
%{dep:middle_end/flambda2/numbers/flambda2_numbers.cmxa}
%{dep:middle_end/flambda2/kinds/flambda2_kinds.cmxa}
%{dep:middle_end/flambda2/identifiers/flambda2_identifiers.cmxa}
%{dep:middle_end/flambda2/nominal/flambda2_nominal.cmxa}
%{dep:middle_end/flambda2/lattices/flambda2_lattices.cmxa}
%{dep:middle_end/flambda2/bound_identifiers/flambda2_bound_identifiers.cmxa}
%{dep:middle_end/flambda2/term_basics/flambda2_term_basics.cmxa}
%{dep:middle_end/flambda2/classic_mode_types/flambda2_classic_mode_types.cmxa}
%{dep:middle_end/flambda2/types/flambda2_types.cmxa}
%{dep:middle_end/flambda2/terms/flambda2_terms.cmxa}
%{dep:middle_end/flambda2/simplify_shared/flambda2_simplify_shared.cmxa}
%{dep:middle_end/flambda2/cmx/flambda2_cmx.cmxa}
%{dep:middle_end/flambda2/from_lambda/flambda2_from_lambda.cmxa}
%{dep:middle_end/flambda2/simplify/flambda2_simplify.cmxa}
%{dep:middle_end/flambda2/reaper/flambda2_reaper.cmxa}
%{dep:middle_end/flambda2/parser/flambda2_parser.cmxa}
%{dep:external/owee/compiler_owee.cmxa}
%{dep:external/gc-timings/gc_timings.cmxa}
%{dep:ocamloptcomp.cmxa}
%{dep:middle_end/flambda2/to_cmm/flambda2_to_cmm.cmxa}
%{dep:middle_end/flambda2/flambda2.cmxa})))
(install
(files
(flambda_backend_main.bc as ocamlopt.byte)
(flambda_backend_main_native.exe as ocamlopt.opt))
(section bin)
(package ocaml))
(install
(files
(compilerlibs/META as compiler-libs/META)
(external/owee/libcompiler_owee_stubs.a
as
compiler-libs/libcompiler_owee_stubs.a)
(external/owee/libcompiler_owee_stubs.a
as
compiler-libs/libcompiler_owee_stubs_native.a)
(external/gc-timings/libgc_timings_stubs.a
as
compiler-libs/libgc_timings_stubs.a)
(external/gc-timings/libgc_timings_stubs.a
as
compiler-libs/libgc_timings_stubs_native.a)
(middle_end/flambda2/numbers/floats/libflambda2_floats_stubs.a
as
compiler-libs/libflambda2_floats_stubs.a)
(middle_end/flambda2/numbers/floats/libflambda2_floats_stubs.a
as
compiler-libs/libflambda2_floats_stubs_native.a)
; for special_dune compat
(ocamloptcomp_with_flambda2.cma as compiler-libs/ocamloptcomp.cma)
(ocamloptcomp_with_flambda2.cmxa as compiler-libs/ocamloptcomp.cmxa)
(ocamloptcomp_with_flambda2.a as compiler-libs/ocamloptcomp.a))
(section lib)
(package ocaml))
(rule
(targets compiler-libs-installation.sexp)
(deps
; Note that Dune doesn't allow globbing in the path part of the filename,
; so this is a bit more repetitive than it could be. Also, as far as I can
; tell, (glob_files_rec) simply doesn't work.
(glob_files *.mli)
(glob_files .ocamlbytecomp.objs/byte/*.{cmi,cmo,cmt,cmti})
(glob_files .ocamlbytecomp.objs/native/*.cmx)
(glob_files .ocamlcommon.objs/byte/*.{cmi,cmo,cmt,cmti})
(glob_files .ocamlcommon.objs/native/*.cmx)
(glob_files .ocamloptcomp.objs/byte/*.{cmi,cmo,cmt,cmti})
(glob_files .ocamloptcomp.objs/native/*.cmx)
(glob_files
backend/asm_targets/.asm_targets.objs/byte/asm_targets.{cmi,cmo,cmt})
(glob_files_rec
backend/asm_targets/.asm_targets.objs/native/asm_targets.cmx)
(glob_files middle_end/flambda2/.flambda2objs/byte/flambda2.{cmi,cmt})
(glob_files
middle_end/flambda2/to_cmm/.flambda2_to_cmm.objs/byte/flambda2_to_cmm{,__To_cmm}.{cmi,cmt})
(glob_files
.flambda_backend_common.objs/byte/flambda_backend_{args,flags}.{cmi,cmo,cmt,cmti})
(glob_files
.flambda_backend_common.objs/native/flambda_backend_{args,flags}.cmx)
backend/debug/dwarf/dwarf_flags/dwarf_flags.mli
(glob_files
backend/debug/dwarf/dwarf_flags/.dwarf_flags.objs/byte/dwarf_flags.{cmi,cmo,cmt,cmti})
backend/debug/dwarf/dwarf_flags/.dwarf_flags.objs/native/dwarf_flags.cmx
(glob_files
backend/debug/dwarf/dwarf_low/.dwarf_low.objs/byte/*.{cmi,cmo,cmt})
(glob_files backend/debug/dwarf/dwarf_low/.dwarf_low.objs/native/*.cmx)
(glob_files
backend/debug/dwarf/dwarf_high/.dwarf_high.objs/byte/*.{cmi,cmo,cmt})
(glob_files backend/debug/dwarf/dwarf_high/.dwarf_high.objs/native/*.cmx)
(glob_files backend/debug/dwarf/dwarf_ocaml/.dwarf_ocaml.objs/native/*.cmx)
(glob_files external/owee/.compiler_owee.objs/byte/*.{cmi,cmo,cmt,cmti})
(glob_files external/owee/.compiler_owee.objs/native/*.cmx)
(glob_files
external/gc-timings/.gc_timings.objs/byte/gc_timings.{cmi,cmti})
external/gc-timings/.gc_timings.objs/native/gc_timings.cmx)
(action
(with-stdout-to
compiler-libs-installation.sexp
(run tools/gen_compiler_libs_installation.exe %{deps}))))
(install
(section lib)
(package ocaml)
(files
(include compiler-libs-installation.sexp)))
; This is entirely redundant, but without it, each target in these libraries
; and their dependencies waits until ocamlcommon is built, including those
; targets that don't actually depend on it. This produces severe bottlenecking,
; costing about 15 seconds when building in dev mode. It's not immediately clear
; why Dune fails to parallelise here. Going by the progress indicator, my best
; guess is that targets in subdirectories aren't even discovered until
; ocamlcommon is built, unless something in the subdirectory is explicitly made
; a dependency.
(alias
(name install)
(package ocaml)
(deps
otherlibs/dynlink/dynlink.cma
otherlibs/dynlink/dynlink.cmxa
middle_end/flambda2/from_lambda/flambda2_from_lambda.cma
middle_end/flambda2/from_lambda/flambda2_from_lambda.cmxa))