I am somewhat of a beginner in C and have a project due where I need to include a makefile to compile my single file program that uses pthreads and semaphores. My makefile looks like:
# Makefile for pizza program
pizza: pizza.o
gcc -lrt -lpthread -g -o pizza pizza.o
pizza.o: pizza.c
gcc -lrt -lpthread -g -c pizza.o pizza.c
and I keep getting:
make: Nothing to be done for 'Makefile'.
I have done several makefiles before and have never gotten this message. I've tried different semantics in the makefile and have only gotten this same message. And yes, the command is tabbed after the target and dependency line.
Using gcc on tcsh. I have read other makefile posts on SO but I wasn't able to use any of the answers to figure it out for my case.
Any help would be greatly appreciated!
make Makefile
instead of justmake
? Alsotcsh
is apparently not a good (or usable) choice of shell for makefile usage (though this makefile doesn't actually seem to usetcsh
for its rule execution).Makefile
... which doesn't exist so make can't do anything. You meanmake
to run the default target ormake pizza
to run thepizza
target.make -f Makefile
since-f
is "use this file as the makefile".