The clean target has its code in the place of dependencies. Also, your code uses spaces instead of tabs. Additionally, you forgot to add the .c
files to the CC command lines. Moreover, you can simplify all the rules to
CFLAGS = -ansi -Wall -pedantic
HEADERS = menu.h file1.h file2.h file3.h file4.h
OBJECTS = menu.o file1.o file2.o file3.o file4.o
CC = gcc
all:runprog
runprog:$(OBJECTS)
$(CC) $(OBJECTS) -o runprog
%.o: %.c $(HEADERS)
$(CC) -c -o $@ $< $(CFLAGS)
clean:
rm -f *.o runprog