No rule to make target `–f'
I am trying to make a c file like
make –f makefile1
This is my make file:
TestAssn1: test_assign1_1.o dberror.o storage_mgr.o cc -o TestAssn1 test_assign1_1.o dberror.o storage_mgr.o test_assign1_1.o: test_assign1_1.c test_helper.h dberror.h storage_mgr.h cc -c test_assign1_1.c dberror.o: dberror.c dberror.h cc -c dberror.c storage_mgr.o: storage_mgr.c storage_mgr.h dberror.h cc -c storage_mgr.c
But I only get this message:
make: *** No rule to make target `–f'. Stop.
How should I correct this?
You need to use a normal dash (-), not an en dash, in the command.
My guess is you copied this command from a blog or other web source. Many blog/web frameworks have a bug where they will replace typewriter punctuation with their typographically correct counterparts even within code formatted text.
This is very odd as your make usage is correct per http://linux.die.net/man/1/make
Please try some of the other formats for this option:
-f file, --file=file, --makefile=FILE Use file as a makefile.
Otherwise, perhaps your make is not the one listed in that man page (which is GNU make).