Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR concludes the series aimed at making the makefiles portable. (Build instructions are yet to be updated.)
As a result, building Unison now works with GNU Make, BSD make, Solaris make and NMAKE. GNU tools and a POSIX shell are no longer needed. Additionally, building the manpage and docs works with all of the above, except with NMAKE.
The first commit could theoretically be split into smaller pieces but I chose not to do it for a few reasons. First, I wanted to keep it together for the history. Reviewing it in detail is likely not feasible anyway, and ensuring it does not break anything is a task better achieved via CI and manual testing.
A short summary of what is going on: The series of PRs so far has gradually changed/simplified the makefile contents so that it becomes acceptable for serveral
make
implementations. Any remaining parts that can't be made portable with simple syntax changes have been moved out into a separate script (the first commit in this PR). The script is written in OCaml because OCaml is required for building anyway and this way we can be completely portable. Any remaining shell invocations in the makefiles have been simplified to the degree that they become acceptable for the shell in Windows. This way we no longer depend on GNU tools, a POSIX shell, or otherwise have specific expectations on the environment. The separate script is invoked automatically every timemake
is run to generate configuration files that are included in the makefile. The script uses a syntax that, if you squint really hard, resembles the makefile a little bit.Nothing changes from the user's perspective, except they no longer have to use
gmake
.I have tested this with all of the make implementations mentioned above (some manually, some with CI). BSD make has been tested in NetBSD, FreeBSD, OpenBSD and DragonFly BSD. Solaris (d)make has been tested in OmniOS and Oracle Solaris.