Skip to content

Merge runtime/Makefile in the root Makefile#11248

Merged
shindere merged 6 commits intoocaml:trunkfrom
shindere:merge-runtime-makefile
May 11, 2022
Merged

Merge runtime/Makefile in the root Makefile#11248
shindere merged 6 commits intoocaml:trunkfrom
shindere:merge-runtime-makefile

Conversation

@shindere
Copy link
Copy Markdown
Contributor

@shindere shindere commented May 9, 2022

This continues the work started in #11243.

This PR changes where the dependencies for C files are stored, from
runtime/.dep before to .dep/runtime now.

@shindere shindere force-pushed the merge-runtime-makefile branch 4 times, most recently from 453497c to 498176c Compare May 10, 2022 13:17
@shindere shindere force-pushed the merge-runtime-makefile branch from 498176c to 97c5b3c Compare May 10, 2022 16:55
Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor typos - but the only error I think is the tightening of the dependencies pulled in by make stdlib/libcamlrun.a.

(for anyone else who wishes to check, this PR is best reviewed commit-by-commit and is much easier to review from a checkout where you can compare the new part of the root Makefile against the deleted runtime/Makefile)

It'll be really great in the next phase of this work when we get to exploit the parallelism opportunities which should come from having eliminating the recursive make calls!

Makefile Outdated
startup_byt \
))
runtime_BYTECODE_C_SOURCES = \
$(runtime_COMMON_C_SOURCES) $(runtime_BYTECODE_ONLY_C_SOURCES)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibility, which would avoid the addsuffix and addprefix in the names:

runtime_BYTECODE_C_SOURCES = \
  $(runtime_COMMON_C_SOURCES:%=runtime/%.c) \
  $(runtime_BYTECODE_ONLY_C_SOURCES:%=runtime/%.c)

Makefile Outdated
runtime_NATIVE_C_SOURCES = \
$(runtime_COMMON_C_SOURCES) $(runtime_NATIVE_ONLY_C_SOURCES)

#* Header files generated by configure
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: asterisk instead of hash in ##

Makefile Outdated
SAK_CFLAGS ?= $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS)
SAK_LINK ?= $(MKEXE_USING_COMPILER)


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: extra blank line here

Makefile Outdated
rm -f runtime/primitives runtime/primitives.new runtime/prims.c \
$(runtime_BUILT_HEADERS)
rm -f runtime/domain_state*.inc
rm -rf $(DEPDIR)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine, but just noting that this erases all dependencies, not just $(DEPDIR)/runtime

Makefile Outdated
makeruntimeopt:
$(MAKE) $(BOOT_FLEXLINK_CMD) runtime-allopt
stdlib/libasmrun.$(A): runtime-allopt
cp runtime/libasmrun.$(A) $@
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is as before, but we could take the opportunity to use $(LN) here instead of cp, as for stdlib/libcamlrun.$(A)

Makefile Outdated
.PHONY: makeruntime
makeruntime:
$(MAKE) $(BOOT_FLEXLINK_CMD) runtime-all
stdlib/libcamlrun.$(A): runtime/libcamlrun.$(A)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, as with stdlib/libasmrun.$(A) below, the dependency needs to be runtime-all, or you can't do make world.opt ; make clean ; make opt.opt (i.e. this step implicitly updates runtime/ocamlrun which has been lost with this change).

@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented May 11, 2022 via email

Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI remains happy - LGTM!

@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented May 11, 2022 via email

shindere added 2 commits May 11, 2022 12:48
This commit moves the computed dependencies of C files from runtime/.dep
to .dep/runtime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants