| 1 |
;************************************************************************** |
| 2 |
;* * |
| 3 |
;* OCaml * |
| 4 |
;* * |
| 5 |
;* Thomas Refis, Jane Street Europe * |
| 6 |
;* * |
| 7 |
;* Copyright 2018 Jane Street Group LLC * |
| 8 |
;* * |
| 9 |
;* All rights reserved. This file is distributed under the terms of * |
| 10 |
;* the GNU Lesser General Public License version 2.1, with the * |
| 11 |
;* special exception on linking described in the file LICENSE. * |
| 12 |
;* * |
| 13 |
;************************************************************************** |
| 14 |
|
| 15 |
(rule |
| 16 |
(targets primitives prims.c) |
| 17 |
(mode fallback) |
| 18 |
(deps |
| 19 |
; matches the line structure of files in gen_primitives.sh |
| 20 |
alloc.c array.c compare.c extern.c floats.c gc_ctrl.c hash.c intern.c |
| 21 |
interp.c ints.c io.c |
| 22 |
lexing.c md5.c meta.c memprof.c obj.c parsing.c signals.c str.c sys.c |
| 23 |
callback.c weak.c |
| 24 |
finalise.c domain.c platform.c fiber.c memory.c startup_aux.c |
| 25 |
runtime_events.c sync.c |
| 26 |
dynlink.c backtrace_byt.c backtrace.c afl.c bigarray.c prng.c) |
| 27 |
(action |
| 28 |
(progn |
| 29 |
(run %{dep:gen_primitives.sh} primitives %{deps}) |
| 30 |
(with-stdout-to prims.c (run %{dep:gen_primsc.sh} primitives %{deps}))))) |
| 31 |
|
| 32 |
(rule |
| 33 |
(targets libcamlrun.a) |
| 34 |
(mode fallback) |
| 35 |
(deps |
| 36 |
../Makefile.config |
| 37 |
../Makefile.build_config |
| 38 |
../Makefile.config_if_required |
| 39 |
../Makefile.common Makefile |
| 40 |
(glob_files caml/*.h) |
| 41 |
; matches the line structure of files in Makefile/BYTECODE_C_SOURCES |
| 42 |
interp.c misc.c fix_code.c startup_aux.c startup_byt.c freelist.c |
| 43 |
major_gc.c |
| 44 |
minor_gc.c memory.c alloc.c roots_byt.c globroots.c fail_byt.c signals.c |
| 45 |
signals_byt.c printexc.c backtrace_byt.c backtrace.c compare.c ints.c |
| 46 |
floats.c str.c array.c io.c extern.c intern.c hash.c sys.c meta.c parsing.c |
| 47 |
gc_ctrl.c md5.c obj.c |
| 48 |
lexing.c callback.c debugger.c weak.c compact.c finalise.c custom.c dynlink.c |
| 49 |
afl.c unix.c win32.c bigarray.c main.c memprof.c domain.c |
| 50 |
skiplist.c codefrag.c |
| 51 |
) |
| 52 |
(action |
| 53 |
(progn |
| 54 |
(bash "touch .depend") ; hack. |
| 55 |
(run make %{targets} COMPUTE_DEPS=false) |
| 56 |
(bash "rm .depend")))) |
| 57 |
|
| 58 |
;; HACK |
| 59 |
(library |
| 60 |
(name runtime) |
| 61 |
(modes byte) |
| 62 |
(wrapped false) |
| 63 |
(modules runtime) |
| 64 |
(flags (-nostdlib -nopervasives)) |
| 65 |
(library_flags -cclib "-I runtime") |
| 66 |
(self_build_stubs_archive (runtime))) |
| 67 |
|
| 68 |
(rule |
| 69 |
(targets libruntime_stubs.a) |
| 70 |
(action (copy libcamlrun.a %{targets}))) |
| 71 |
|
| 72 |
(rule |
| 73 |
(targets runtime.ml) |
| 74 |
(action (write-file %{targets} "let linkme = ()"))) |