When ns am in ~ the last makefile (#5), the "make" can"t proceed becasue (error prompt) No ascendancy to make target "obj/hellomake.o", necessary by "hellomake". This piece of password tries to compile the resources files and put libs, srcs, objs right into respective folders.
You are watching: No rule to make target c++
IDIR =../includeCC=gccCFLAGS=-I$(IDIR)ODIR=objLDIR =../libLIBS=-lm_DEPS = hellomake.hDEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))_OBJ = hellomake.o hellofunc.o OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))$(ODIR)/%.o: %.c $(DEPS) $(CC) -c -o $
$I have been staring at it because that an hour already, it"s not a complicated piece that code however I couldn"t eyeball the problem. I suspect the difficulty happens here:
$(ODIR)/%.o: %.c $(DEPS) $(CC) -c -o $
Their script is fine! simply do this:
1°) Create catalog "include" and "src"
mkdir include; mkdir src2°) develop an "obj" folder inside "src"
mkdir obj3°) Your magazine tree should look prefer this:
$:~/parentDir$ tree.├── include│ └── hellomake.h└── src ├── hellofunc.c ├── hellomake ├── hellomake.c ├── Makefile └── obj ├── hellofunc.o └── hellomake.o4°) Now just use make command within src directory. :D
If you carry out not have a source document named hellomake.c, make does not know how to do obj/hellomake.o. You should likewise create the obj catalog yourself due to the fact that you perform not have a command to execute so in the Makefile, however its absence would not cause the error you report.
You most likely know better and the explanation may be more subtle:
I suspect there is a missing TAB personality at the beginning of this line:
$(CC) -c -o $
$Commands are introduced by TAB characters in Makefiles, no spaces. It is unfortunate, yet nobody seems to want to settle this.
I remember conference Stuart Feldman at Bell Labs in 1984: he was introduced to me as the inventor that make. Before I can say anything, he timeless apologized this way: I know, sorry about he TABs!
Thanks because that contributing solution to stack Overflow!Please be certain to answer the question. Carry out details and also share her research!
But avoid …Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with referrals or an individual experience.
See more: Out On A Limb Tree Service, Out On A Limb Tree Care, Inc
To find out more, watch our advice on writing good answers.
article Your prize Discard
Not the answer you're looking for? Browse various other questions tagged c makefile gnu-make or questioning your own question.
site style / logo © 2021 stack Exchange Inc; user contributions licensed under cc by-sa. Rev2021.12.20.41044