For simple program eg, proc.c
which has only one source file, it's convenient to compile and link using just make proc
, which by default search for proc.c
and create proc
as output file. There is no need to create a Makefile
for that.
If proc.c
requires to link with some library such as the math library (defined by <math.h>
). Using gcc
directly, we can use gcc -c proc.c -o proc -lm
. Is there an equivalent make
command line option to specify -lm
so we can use make
command directly without writing a Makefile
?
Similar task suggested by Basile Starynkevitch: