I try to create a make file for different targets.
I get the the followinfg warnings.
makefile:15: warning: overriding recipe for target 'main.o'
makefile:9: warning: ignoring old recipe for target 'main.o'
clang -c main.c
clang main.o -o main.exe
Compilation finished successfully.
How do I fix the warnings
I came up with something similar but using implicit rules. The only problem is that you need to remember to make clean before you make release (or just make) or make debug since it considers either one to already be built since the output files have the same name.
Shouldn't -Wshadow be enabled by -Wpedantic? I'm not sure so I left it in.
I also used rm instead of del, which I know nothing about since I use linux.
make clean
del *.o main.exe
Could Not Find *.o
C:\Users\Vedanta Centre\Desktop\Make Demo>
make release
make: *** No rule to make target 'main.exe', needed by 'release'. Stop.
make debug
make: *** No rule to make target 'main.exe', needed by 'debug'. Stop.
C:\Users\Vedanta Centre\Desktop\Make Demo>