Read more about GNU make and take time to read its documentation.
Your variable assignment
SOURCES=$ main.c inc/prog_lib.c
is wrong. It should be
SOURCES= main.c prog_lib.c
You probably need also (better ask for -g
to facilitate debugging with gdb
)
CFLAGS= -O0 -c -Wall -g -mavx2 -mfma -Iinc
Try also make -p
to understand the builtin rules. You should use them better (and then using -c
in your CFLAGS
is probably wrong).
Consider using remake, perhaps as remake -x
, to debug your Makefile
; or at least make --trace
.
BTW, I believe that your file hierarchy is too complex and inappropriate. For such a simple and small project, having an inc/
directory is not worth the pain.
For inspiration, study the Makefile
of some existing free software, e.g. on github.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…