Skip to content

Commit 15d38c0

Browse files
authored
make install puts ocamlc at workspace root (#152)
This `ocamlc` is nicer to use with `ocamldebug`, as the `ocamldebug` session inherits the pwd of the bytecode file you pass as argument. In particular, breakpoints bring you to the proper file if you use the root `ocamlc`, and bring you to the copied file in the `_build` directory if you use the `$USER-out/bin/` `ocamlc`.
1 parent b4928ee commit 15d38c0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Makefile.common-jst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,16 @@ _install: compiler
166166
-or -name "flambda2*.cmti" -or -name "flambda2*.cmt" \) \
167167
-exec cp -f {} _install/lib/ocaml/compiler-libs \;
168168

169-
# Copy _install to the final install directory (no-op if they are the same)
169+
# Copy _install to the final install directory (no-op if they are the same).
170+
# Also generate ocamlc at the root of the repo, as this is convenient to use
171+
# with ocamldebug: ocamldebug inherits the pwd of the file passed as argument,
172+
# so breakpoints bring you to the less-convenient _build source file if you use
173+
# the ocamlc.byte in $prefix/bin.
170174
install: _install
171175
mkdir -p '$(prefix)'
172176
rsync --chmod=u+rw,go+r -rl _install/ '$(prefix)'
177+
rm -f ocamlc
178+
ln -s '$(prefix)'/bin/ocamlc.byte ocamlc
173179

174180
# Same as above, but relies on a successfull earlier _install
175181
install_for_opam:

0 commit comments

Comments
 (0)