I am new to C and am trying to create a makefile. I have to compile the following files: A2.c (functions) a2_q1.c (consists of the main function) and a2_q1.c (consists of another main function). This is what I have:
makefile:
CC = GCC
CCFLAGS = -Wall
main: A2.o a2_q2.o a2_q1.o
$(CC) $(CCFLAGS) -o main a2_q2.o a2_q1.o A2.o
a2_q2.o: a2_q2.c
$(CC) $(CCFLAGS) -c a2_q2.c
a2_q1.o: a2_q1.c
$(CC) $(CCFLAGS) -c a2_q1.c
A2.o: A2.c
$(CC) $(CCFLAGS) -c A2
clean:
rm -f main A2.o a2_q2.o a2_q1.o
Every time I run this I get the following error:
Please advice.