Live data from Hacker News

The Language Agnostic, All-Purpose, Incredible, Makefile

blog.mindlessness.life

1–10 of 124 posts

Re: The Language Agnostic, All-Purpose, Incredible, Makefile

#2
Make is great, and I wish more people would use it in place of whatever monstrosity is en vogue this week.

However, there is one thing which Make absolutely cannot handle, and that is file names with spaces. If you have any risk of encountering these without any possibility of renaming them, you’ll sadly have to give up on using Make; it just won’t work.

Re: The Language Agnostic, All-Purpose, Incredible, Makefile

#4
post #2

Make is great, and I wish more people would use it in place of whatever monstrosity is en vogue this week. However, there is one thing which Make absolutely cannot handle, and that is file names with spaces . If you have any risk of encountering these without any possibility of renaming them, you’ll sadly have to give up on using Make; it just won’t work.

Make is my default. However, as the project grows, I find myself wanting to organize modules by directory and I find it cleaner to switch to CMake which then generates the Makefiles for me.

Re: The Language Agnostic, All-Purpose, Incredible, Makefile

#5
post #3

I like make, but I had a lot more luck with just/justfile, which is similar to make conceptually but with less idiosyncratic syntax/execution.

Just works with file names with spaces?

https://stackoverflow.com/questions/9838384/can-gnu-make-han...

Re: The Language Agnostic, All-Purpose, Incredible, Makefile

#7
post #2

Make is great, and I wish more people would use it in place of whatever monstrosity is en vogue this week. However, there is one thing which Make absolutely cannot handle, and that is file names with spaces . If you have any risk of encountering these without any possibility of renaming them, you’ll sadly have to give up on using Make; it just won’t work.

I agree, and the solution to this problem is to forbid filenames with spaces. The convenience of make and similar tools is much more important than spaces in filenames. File names with spaces should not be allowed in modern filesystems. When the user types a filename with spaces, the GUI should encode the space as a non-breaking space character, that does not cause havoc in scripts.

Re: The Language Agnostic, All-Purpose, Incredible, Makefile

#9
Make is great as a dependency resolution engine.

For everything else, it is absolutely horrible.

What I typically do is use make only for what it is good: as a dependency resolution back-end.

All the build logic for my projects is written in Python, in an executable file stored in the project root directory and called "make" (I have "." in my PATH).

The Python script, when it runs, generates on the fly a clean, lean, readable, unrolled, Makefile and feeds it directly to /usr/bin/make via a pipe.

Works like a charm:

Python (a sane and expressive programing language) to express the high-level logic needed to build the project.

Make as a solid back-end to solve the "what needs to be rebuilt" problem (especially the parallel version with -jXX)

Re: The Language Agnostic, All-Purpose, Incredible, Makefile

#10
post #3

I like make, but I had a lot more luck with just/justfile, which is similar to make conceptually but with less idiosyncratic syntax/execution.

Looked it up:

https://github.com/casey/just

Very nice after a quick look. Too bad it's not as common as `make`.

Post reply on HN