In my lab2 directory, there's the following: bit_decode.c, and MakefileLab2.txt my…
- User
In my lab2 directory, there's the following:
bit_decode.c, and MakefileLab2.txt
my professor expects "make lab2.zip" to just work but I'm getting make: *** No rule to make target 'MakefileLab2'. Stop.
- Assistant
It looks like you are using a different name for your Makefile than what the
makecommand expects. By default,makelooks for a file namedMakefileormakefile. Your file is namedMakefileLab2.txt, so you'll need to explicitly tellmaketo use this file. Here is how you can do it:-
Rename your
MakefileLab2.txttoMakefileso thatmakecan find it automatically, or specify the file manually. -
If you choose to specify the file manually, you need to use the
-fflag to tellmakewhich file to use. Assuming you want to createlab2.zipusing your current Makefile, you should run:bashmake -f MakefileLab2.txt lab2.zip -
Make sure your
MakefileLab2.txt(orMakefileif renamed) has a rule to create . Here’s an example of what such a rule might look like:
-