I have just started learning make and I am having some trouble. I want to create an executable called sortfile. Here are the relevant files: sortfile.c fileio.c fileio.h
Both sortfile.c and fileio.c use fileio.h.
Here is my makefile:
1 CC = gcc 2 CFLAGS = -g -Wall 3 4 default: sortfile 5 6 sortfile: sortfile.o fileio.o $(CC) $(CFLAGS) -o sortfile sortfile.o fileio.o 7 8 sortfile.o: sortfile.c fileio.h $(CC) $(CFLAGS) -c sortfile.c 9 10 fileio.o: fileio.c fileio.h $(CC) $(CFLAGS) -c fileio.c 11 12 clean: 13 $(RM) sortfile *.o*~ I am getting the following error:
make: *** No rule to make target `gcc', needed by `sortfile.o'. Stop.