New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove duplication in Makefile #149
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9ef47e6
to
8555530
Compare
I thought the % makefiles rules were not portable because they are not POSIX, but they are at least working on BSD make : https://notqmail.z0.is/patch/0-patch/85555302dd1f6688babb236eb364e9e6f08c96ac/index.make.out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With these changes, along with multiple others, it looks like we are going more toward hand-maintained Makefile.
As the total number of files decrease (by using libc more), it might become more and more feasible to do so.
Is that the direction we are taking?
My interpretation was the opposite. Interesting. I was thinking anything that highlights patterns in our existing dependencies is a step toward automation. But I’m not actually using redo, and you are. Does this change feel counterproductive to you, or not obviously worth the cost, or something like that? |
8555530
to
dda01cd
Compare
dda01cd
to
91fc59e
Compare
91fc59e
to
eb0013e
Compare
Could someone please test if this actually honors both rules? I had the impression that BSD make was only looking at the compile-rule, but ignoring the later dependency rules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this removes dependency on headers: if they get modified and the project is recompiled, the associated .o might not be recompiled. Did nowaday NVMe disks made make clean all cheap enough?
This also introduces %
rules that are not POSIX, but there are already common extensions used.
@@ -21,6 +21,9 @@ default: it | |||
.8.0: | |||
$(NROFF) -man $< >$@ | |||
|
|||
%.o: %.c compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A slightly less readable but more portable way would be .c.o:
, but I doubt this would support adding compile
as dependency of .o
.
This was basically my question. This is not intended, and it works with GNU make, but if BSD make doesn't support this I can scrap half of it because that is a regression. |
https://notqmail.z0.is/commit/03b8497487b7ebc0580d92059ae77171fff71601/patch/0/log Works without trouble on that instance. |
Basically the same what we have already done for catman targets.