Here's the output of make
(which is the debug
target by default):
cc -Wall -Wpedantic -Wextra -Og -ggdb -DDEBUG -c -o main.o main.c
cc -Wall -Wpedantic -Wextra -Og -ggdb -DDEBUG -c -o test.o test.c
OBJS = out/debug/main.o out/debug/test.o
Compiling executable test:
cc -DDEBUG -Wall -Wpedantic -Wextra -Og -ggdb out/debug/main.o out/debug/test.o -o o
ut/debug/test
cc: error: out/debug/main.o: No such file or directory
cc: error: out/debug/test.o: No such file or directory
cc: fatal error: no input files
compilation terminated.
make: *** [Makefile:36: executable] Error 1
And make release
, pretty much the same:
OBJS = out/release/main.o out/release/test.o
Compiling executable test:
cc -DNDEBUG -Wall -Wpedantic -Wextra -Os -flto out/release/main.o out/release/test.o
-o out/release/test
cc: error: out/release/main.o: No such file or directory
cc: error: out/release/test.o: No such file or directory
cc: fatal error: no input files
compilation terminated.
make: *** [Makefile:36: executable] Error 1
The problem seems to be in the pattern on line 39 of the makefile.
It doesn't echo "Compiling
I think it doesn't even reach the "%.o from %.c" pattern because it doesn't have a name, so the debug
and release
targets can't depend on it.