lwinkenb
asked on
Makefile question. "No rule to make target..."
If I have a makefile rule like:
myprog.o : myprog.cpp
g++ -g -Wall -c myprog.cpp
Why does make say:
"make: *** No rule to make target `myprog.cpp', needed by `myprog.o'. Stop."
How do you set up a rule to make a cpp file?
myprog.o : myprog.cpp
g++ -g -Wall -c myprog.cpp
Why does make say:
"make: *** No rule to make target `myprog.cpp', needed by `myprog.o'. Stop."
How do you set up a rule to make a cpp file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
then in the sources directory you can do
INCL = -I. -I../ -I../Include
OPTIONS = -Wall -O2
all:
.c.o:
$(CC) -c $(OPTIONS) $(INCL) $< -o $@
regards
Manish Regmi
INCL = -I. -I../ -I../Include
OPTIONS = -Wall -O2
all:
.c.o:
$(CC) -c $(OPTIONS) $(INCL) $< -o $@
regards
Manish Regmi
ASKER
Makefile
Sources (directory)
Include (directory)
How do I tell the Makefile that the source files are in the Sources directory.