by raggi · 4y ago · 0 comments
General reminder: you don't even necessarily need a make file to build C:
~ % echo 'void main(){printf("hello");}' > example.c
~ % make example
cc example.c -o example
...
2 warnings generated.
~ % ./example
hello%I tried it myself though and it complains about not including stdio.h and wanting `int main` instead of `void main`. Though of course I still get your point.
What this does allow you to do though, is also do things like:
make CFLAGS=-DFOO LDFLAGS=-lfoo example