-
Notifications
You must be signed in to change notification settings - Fork 68
Add in-depth introduction for Fortran with make #160
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
Conversation
What is the level of sophistication you intend to reach? I have seen incredibly complicated Makefiles (mostly generated via tools like automake) that are not intended to be read or understood by mere mortals, but I have never encountered functions, maps, loops over lists or eval, at least not in Makefiles that were intended for mere mortals. |
The aim is to show a concise, scalable and still readable handwritten Makefile. The resulting Makefile will probably be sophisticated, but not complicated or bloated like an autogenerated Makefile. The part I wrote so far targets only the generation of dependencies in an automatic way, explaining the other features while showing use-cases for them. |
I like this idea and think it will be useful. It will be useful for me for sure. I even own a book on GNU Make that I struggled learning anything useful from. If the guide shows to be advanced, we can always give a heads-up note at the beginning of the guide, stating the intended level and who it's for. |
Here is an example of a manual Makefile that we use in stdlib: and it has module dependencies, and yet is seems simpler than the one proposed in this PR (no |
There is certainly more than one style of I find the substitution reference mechanism of |
I see. The approach that I like the most is |
@certik The scope of this PR is to give an advanced introduction to
I agree that |
Let's give this PR another bump, since it has been stale for a while now. This guide builds on the basic The automation of the dependencies is one of the main issues faced when using If this is not suited for the building programs book, I would suggest to start a new book on build systems and development tools as intermediate minibook instead. |
I just talked with @awvwgk over video regarding this issue and I am fine with merging it as is. While we all work hard on So I am for merging this, and see what the response is, and if we get feedback, we can iterate on it. @milancurcic, are you ok to merge as is? |
I will review it over the weekend and will have minor edit suggestions. But overall I think it's a great addition. Thank you for putting it together! |
I agree - it is a straightforward receipe for creating makefiles in a
generic way. And it definitely contains features that I was unaware of.
Op vr 18 dec. 2020 om 20:33 schreef Milan Curcic <notifications@github.com>:
… I will review it over the weekend and will have minor edit suggestions.
But overall I think it's a great addition. Thank you for putting it
together!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#160 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YRZAWLMJFVTHUMA67ETSVOVA3ANCNFSM4TA7XQFQ>
.
|
Might be a good occasion to check if the #build_preview is working again. Edit: Nope, it's still broken. |
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.
I left many minor editorial suggestions. They mostly address sentences that are too long or some redundant wording.
I'm not sure about the whole awk scripting for dependencies. As you write, it doesn't generally work, only for some simpler cases. Being unfamiliar with awk, reading this part was daunting to me. When I saw the script and read that it won't generally work but only for simpler cases, I was already decided that I'll be writing out my dependencies by hand. So it wasn't very useful for me but may be for others. I guess my only problem with this part is that the tutorial spends a significant fraction teaching how to use a non-Fortran low-level tool to do something that will work only sometimes. At the same time, I think it's clear from the text that "you don't have to do this if you don't want to", so the reader can decide for themselves.
Otherwise I think it's good.
Co-authored-by: Milan Curcic <caomaco@gmail.com>
The Hardcoding dependencies is a maintenance effort I found unacceptable for using |
I added some comments on how |
If you have by chance the O'Reilly book Unix for FORTRAN Programmers written by Mike Loukides it contains a nicely written chapter on |
@ivan-pi Thanks for the offer. My best source of knowledge on Unix tools was/is the built-in documentation so far. For example the info page of |
Thanks everybody for the comments and suggestions. With two approvals I'll go ahead and merge this PR. |
I just gave
make
and Fortran another try and realized again why I dropped it from all my project in the first place. Nevertheless, the attempt of writing this up might still be helpful for somebody learningmake
.The idea of the guide is the following, take a real world example from the Fortran package index with medium complexity (more than one source file, but not a huge project), which is not using
make
as build system and describe the process of porting it tomake
as insightful as possible.This guide describes:
make
make
expressions from listsMakefile
with external toolsLet me know what you think about this.