Skip to content

Conversation

@uwiger
Copy link
Contributor

@uwiger uwiger commented Nov 10, 2025

This extension makes it possible to use make to compile almost all source file types supported by erlc. The exception is idl files, which have somewhat complex output.

The change is backwards-compatible, such that any time extensions are omitted, .erl is assumed, and the same logic as before is used. If the extension is given (and other than .erl), the work is passed to erl_compile:compile(Args, CWD), where Args is given by the new make option {erlc, Args}, and is a string, such as would have been given to the erlc command. Modification timestamps are compared as for .erl/.beam pairs, but using the list of supported file types in erl_compile:extensions().

Furthermore, a new load option, autoload is introduced. This is the default when running erl -make, and allows each Emakefile line to specify a load option (load or netload). This allows for parse-transform modules to be compiled and loaded selectively for use by later steps in the Emakefile.

This extension makes it possible to use `make` to compile almost
all source file types supported by `erlc`. The exception is `idl`
files, which have somewhat complex output.

The change is backwards-compatible, such that any time extensions
are omitted, `.erl` is assumed, and the same logic as before is used.
If the extension is given (and other than `.erl`), the work is passed
to `erl_compile:compile(Args, CWD)`, where `Args` is given by the new
`make` option `{erlc, Args}`, and is a string, such as would have been
given to the `erlc` command. Modification timestamps are compared as
for `.erl`/`.beam` pairs, but using the list of supported file types
in `erl_compile:extensions()`.

Furthermore, a new load option, `autoload` is introduced. This is the
default when running `erl -make`, and allows each `Emakefile` line
to specify a load option (`load` or `netload`). This allows for
parse-transform modules to be compiled and loaded selectively for use
by later steps in the `Emakefile`.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

CT Test Results

    3 files    108 suites   1h 10m 17s ⏱️
2 339 tests 2 288 ✅ 51 💤 0 ❌
2 753 runs  2 696 ✅ 57 💤 0 ❌

Results for commit 6a02e81.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@uwiger
Copy link
Contributor Author

uwiger commented Nov 10, 2025

BTW, the suggested license headers in the FILE-HEADERS.md contain some trailing whitespace that git diff --check will flag for.

@uwiger
Copy link
Contributor Author

uwiger commented Nov 12, 2025

I am awaiting comments/review now.
A possible improvement might be to craft default 'erlc' args from top-level compile options (potentially complementing line-level 'erlc' args). But I wasn't sure at which point this would start violating the principle of least surprise, and this would seem like a candidate for future improvement.

@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Nov 13, 2025
@jhogberg jhogberg requested review from bjorng and jhogberg November 17, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:VM Assigned to OTP team VM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants