Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you don't care about incremental builds and want just a full rebuild, I would write a shell script instead of a Makefile.

That said, I think incremental builds are important for most use cases.



Oops, let me amend that. The partial order of make is still useful for parallel builds from scratch, even if you don't care about incremental builds. Like almost all other languages, shell forces a total order on execution.

On the other hand, computers are fast enough that serial full builds indeed work in some cases.


I'd argue that the make syntax and built-in features are a huge boon over starting from plain-old-shell regardless.


What are some examples of that? Shell can do basically everything make can. The syntax of both is ugly but I'll grant that make is more uniform.

And btw there is no way to use make without shell, but you can use shell without make.


I guess it probably comes down to preference, but I can take a list, write a one-line .c->.o transform, a one-line link target, add in a clean target etc etc faster with make.

Sure, I can write these as functions in bash, call once for each source file, check return codes etc etc, but I find expressing dependencies faster than writing anything like robust code in shell, and make deals with failed steps by stopping.


And as you rightly pointed out above - once you get the dependencies nailed down, you can parallel build trivially.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: