0

I have vpath set as follows:

vpath %.cpp $(SRC)

Now if i want to get the list of object files to be created, should it not work with the following ?

COBJS=$(patsubst %.cpp,%.o,$(wildcard *.cpp))

It is not. I am not getting any list of files when i run the command

make --just-print

It only shows the list of object files if i do the following :

COBJS=$(patsubst %.cpp,%.o,$(wildcard $(SRC)/*.cpp))

Any explanation?

pjmorse
  • 9,204
  • 9
  • 54
  • 124
sajis997
  • 1,089
  • 1
  • 15
  • 29

1 Answers1

3

The vpath directive will tell Make where to look for prerequisites of rules. It will have no effect on where the wildcard directive looks for files-- which is a good thing.

Beta
  • 96,650
  • 16
  • 149
  • 150