I'm following a Makefile tutorial, and I've run into an issue with the last example. I keep getting an error that says, "make: *** No rule to make target 'obj/hellomake.o', needed by 'hellomake'. Stop." I've attached a link to the tutorial I'm using. Here's the directory structure I'm working with:
- ./
- include/
- hellomake.h
- lib/
- Makefile
- src/
- hellofunc.c
- hellomake.c
- obj/
1 Answer
Could you share what your Makefile looks like? The error suggests there might be an issue in one of your files that's not visible from the error message alone. Also, let us know which command you ran that resulted in that error!
My Makefile is exactly as shown in the tutorial examples. I just typed "make" to run it.
Everything else compiles fine with other examples, so it must be something about example #5 that's causing the issue. I've checked my directory structure, and it looks correct to me. I also double-checked for proper formatting with tabs.