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

You don't need a Makefile, but you can just run "make foo" and it'll automatically run "cc -o foo foo.c" for you.


Almost thirty years and I never knew that.


Make has builtin rules for most obvious build jobs: https://www.gnu.org/software/make/manual/html_node/Catalogue...

You also can pass env vars to it:

  $ CC=clang make foo
https://www.gnu.org/software/make/manual/html_node/Implicit-...

And (with care) define your own in: https://www.gnu.org/software/make/manual/make.html#MAKEFILES...




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

Search: