when i run the following makefile:
i am getting the following error:
CFLAGS =-O -Wall -Wextra -Wshadow -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
-Wmissing-field-initializers -Wredundant-decls -Wunreachable-code
gcc -o server server2.o
gcc $(CFLAGS) server2.c
rm -f core *.o
could someone point where i am doing it wrong?
gcc: server2.o: No such file or directory
gcc: no input files
make: *** [all] Error 1
> gcc $(CFLAGS) server2.c
This line also needs to include the -c option (compile only) to produce the .o from the .c
Or you could remove the line entirely and rely on Make's pattern handling.