Skip to content

Specify build and source trees in ocamldep#113

Draft
MisterDA wants to merge 3 commits intotrunkfrom
ocamldep-prefix-.depend
Draft

Specify build and source trees in ocamldep#113
MisterDA wants to merge 3 commits intotrunkfrom
ocamldep-prefix-.depend

Conversation

@MisterDA
Copy link
Owner

@MisterDA MisterDA commented Jan 7, 2025

Previous submission at https://github.com/ocaml/ocaml/pull/12239.

@MisterDA MisterDA force-pushed the ocamldep-prefix-.depend branch from 0555c65 to 180bb4e Compare January 8, 2025 09:43
ocamldep generates the list of dependencies of a given OCaml target
file. The new -build-tree option adds a facility to add a (separate)
prefix to the targets and the dependencies in its make output. This
allows make to write targets in an other location than just the
current working directory. Dependencies of the target that are also
build artifacts are also found in this location.

This is useful for out-of-source builds and cross-compilation.

ocamldep outputs a trailing directory separator if the given string
doesn't contain one, and respects -slash and -no-slash options. No
other processing is made on the string. It is for instance possible to
give a Makefile variable instead of a path.
If ocamldep is invoked without `-all`, then the output doesn't refer
to source files and there is no need for `-source-tree`.

If `-all` is used, though, then rules output by ocamldep will refer to
source files and, currently, they will contain the paths to the source
files relative to where ocamldep is run from.

Defining `-source-tree` allows to run the build from a different
directory than of which ocamldep was run.
@MisterDA MisterDA force-pushed the ocamldep-prefix-.depend branch from 180bb4e to 247c093 Compare January 8, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant