-
Notifications
You must be signed in to change notification settings - Fork 86
Fix builds on BSD platforms by invoking "gmake", not "make". #989
Fix builds on BSD platforms by invoking "gmake", not "make". #989
Conversation
I don't like that my patch leaves no "fall-through" default when the operating system isn't one of the ones explicitly listed in the build instructions. But I'm simply using the pattern I saw used with the |
One trick I've done in the past is that GNU make will look for a GNUMakefile before it looks for a Makefile, so you can put all your real make rules in the GNUMakefile and have a Makefile (that BSD make will look for first) that just calls gmake with the target it was provided. |
I like that idea, and I swear I even suggested this in the past, but I seem to recall that we found that solution even more abhorrent for some reason. I think that conversation happened between me at @madninja over a year ago. |
I like it because it resolves which version of make you have as |
but wouldn't bsd make calling make then not require gmake to be installed on all other platforms? |
You'd still need gnumake everywhere: the main Makefiles are written in its syntax. This method just bootstraps BSD make to make it run gnumake. |
Really? I build miner on my Mac laptop and
|
The native |
Right, so blindly calling |
Not what was suggested. The suggestion is:
Anyone whose native Thus, all the special |
Gotcha, so this is saying the BSD users will have to have gmake installed? |
Yes, anyone who is on BSD will have |
Then, on OS X:
|
Sorry for the spam. Guess what? It actually works! The |
Here's a proposed
|
SummaryWe have some options. This I'm ok with either one. I don't want to rock the boat too hard. |
I dislike the platform approach because it requires us to maintain a list of platform to make type mappings whereas the Makefile based approach works no matter what system you are on or what you have I think as long as we have a big comment in the Makefile saying "This is a stub, go edit GNUmakefile instead" it will be fine and it will essentially be 0 maintenance from there on out. |
You could also, in the BSD Makefile, tell the user they need to install GNU make if gmake is not in the PATH. You can't do that via the rebar approach. |
This sounds good to me! I will squash these commits once again and enact what you've suggested, @Vagabond . |
N.B. There are a few other rebar projects that should take this new approach. E.g. |
b3b09d5
to
f04a6f5
Compare
I like this, does @madninja have any objections? (and we should indeed do this on other projects). |
I like it 👍🏻 |
|
oh, did you use |
I used (I'm not a fan of the squash). |
f04a6f5
to
8dea4fc
Compare
I've unsquashed and re-forced the commit. It should appear as a |
8dea4fc
to
113d659
Compare
Part 1: Rename Makefile -> GNUmakefile Adopt a solution to the problem where the system "make" utility is not a GNU-compatible variant by taking advantage of the way GNU Make searches for its Makefile differently from traditional (AT&T V7) make and redirecting the build process to use "gmake", which is the conventional name for GNU Make on such platforms.
113d659
to
c3e6836
Compare
It really looks to be a GitHub bug. I have a Gitea instance I run at home and it preserves the history with this latest commit. GitHub gets confused. |
good enough. We will merge this shortly, thanks. |
aaaand, I've rechecked and GitHub seems ok now. I think the issue is that this needs to stay as two separate commits; we can't squash into one or we trigger the bug. Can you confirm, @Vagabond that the history now looks to be preserved in |
Part 2: New Makefile.
c3e6836
to
1b95585
Compare
(I am truly sorry for the spam; I just updated the commit message in the second commit, thus the latest force push) |
Shall we merge @madninja ? |
No description provided.