(no title)
skore | 5 years ago
I use it heavily and think it's extremely underappreciated, so instead of reinventing it, I would like to build on it. But - trying to extend the old C codebase is daunting. I'd even be happy with a reduced featureset that avoids the exotic stuff that is either outdated or no longer useful. The core syntax of a Makefile is just so close to perfect.
(I wrote about some of this in the remake repo: https://github.com/rocky/remake/issues/114 )
dataflow|5 years ago
> The core syntax of a Makefile is just so close to perfect.
I'd argue what is close to perfect is much of the underlying model/semantics, and what is terrible is very much the syntax. I've long wanted to make something similar to Make but simply with better syntax...
skore|5 years ago
At the level of variable handling and so forth, make is slightly annoying but manageable.
Anything beyond that - yeah, I'm with you, a lot of that is terrible.
cat199|5 years ago
If you haven't, I'd suggest having a look at pmake (sometimes packaged as 'bmake' since it is the base 'make' implementation on BSDs) - the core 'make' portions are still the same (like gmake extends core 'make' as well), but the more script-like 'dynamic' parts are much nicer than gnumake in my opinion. It also supports the notion of 'makefile libraries' which are directories containing make snippets which can be #include's into other client projects.
freebsd examples:
manual: https://www.freebsd.org/cgi/man.cgi?query=make&apropos=0&sek...
makefile library used by the system to build itself (good examples): https://cgit.freebsd.org/src/tree/share/mk
rwmj|5 years ago
Ericson2314|5 years ago
matheusmoreira|5 years ago
GNU Make is hurt by its minimalism. Doing anything interesting in pure GNU Make is a herculean effort. Even something simple like recursing into directories in order to build up a list of source files is extremely hard. Most people don't even try, they would rather keep their source code tree flat than deal with GNU Make. I wanted to support any directory structure so I implemented a simple version of find as a pure GNU Make function!
At the same time, a reduced feature set would be nice. GNU Make ships with a ton of old rules enabled by default. The no-builtin-rules and no-builtin-variables options let you disable this stuff. Makes it a lot easier to understand the print-data-base output.
> The core syntax of a Makefile is just so close to perfect.
It's very simple syntax but it has its pain points. Significant spaces effectively rules out spaces in file names. It also makes it much harder to format custom functions.
Speaking of functions, why can't we call user-defined functions directly? We're forced to use the call function with the custom function's name as parameter. Things quickly get out of hand when you're building new functions on top of existing ones. I actually looked up the GNU Make source code, I remember comments and a discussion about this... It was possible to do it but they didn't want to because then they'd have to think about users when introducing new built-in functions. Oh well...
moonchild|5 years ago
What's wrong with shelling out to find?
nicoburns|5 years ago
It's make-like but supposedly improves on some of the arcane aspects of make (I can't judge how successful it is at that as I've never used make in anger).
jamwaffles|5 years ago
bluejekyll|5 years ago
That makes make a great entry point for any project. Does anyone have a general suggestion about how to work around this? The goal being, sync a project and not need to install anything to get going. One thing I do sometimes is to use make as the entry point, and it has an init target to install the necessary tools to get going (depends on who I know to be the target audience).
cytzol|5 years ago
So while it's replaced one use of Make for me, I can't rightly call it a Make replacement.
candied_scarf|5 years ago
if it was opt-in to him monitoring i might be more open. maybe i should fork and change the filename to keep this from happening
skore|5 years ago
edit: Yeah, I can't see how I can make it work for a file-based approach.
stefan_|5 years ago
https://github.com/google/kati/blob/master/INTERNALS.md
This takes your existing Makefile(s) and produces a ninja build file. Not sure if Android still uses it or it is all soong now.
coldtea|5 years ago
That's about the last thing I would call it.
boris|5 years ago
skore|5 years ago
The one thing that I'm currently struggling to find information on is dynamic dependency handling (dyndep in ninja terms).
Is that something that build2 covers as well? Any resource you could point me to?
deknos|5 years ago
skore|5 years ago
edit: Yeah, doesn't seem like it.
JoshTriplett|5 years ago
I would love to see this completed to the point of passing the GNU make testsuite. Having make as a modular library would be wildly useful.
JetSpiegel|5 years ago
https://ninja-build.org/
layoutIfNeeded|5 years ago