I have a simple makefile that compiles a p.c file to an executable using gcc on Linux.
The p.c file depends on a a.h file.
My makefile looks like this:
//makefile
CC = gcc
build: p.c a.h
$(CC) -o out p.c
clean:
rm -f *.exe
rebuild: clean build
Your makefile doesn’t produce the files it promises to produce, namely
build,cleanandrebuild. Since these targets are not files they should be marked as phony targets:buildtarget should be: