Subdirectories in makefiles
Chris Mahoney (1684) 2099 posts |
Me again; be afraid! :) I have a directory structure similar to this (hopefully my diagram is understandable):
In my CLibrary-based makefile I can use the line But how do I grab the files that are in subdirectories? If I use Is there some magic incantation I can use to get this working? I could do it the old fashioned way but I’d prefer not to abandon the shared makefiles if I can help it. Any ideas? Edit: Alternatively, I’d be happy with building each subdirectory as its own library (in this case, creating “subdir1” and “subdir2” libraries) and then linking them all together. That might actually be better in the long run, but at this point I’ll take any example code I can get :) |
Jeff Doggett (257) 231 posts |
There are all sorts of magic incantations for Makefiles – it’s seriously complicated. Here’s an example from another project….
|
Colin (478) 2433 posts |
For DDE makefiles this works
where the directory structure is
Note all of the ‘o’ files will be put in the top level ‘o’ directory so all the files need different names. VPATH is a space separated list of paths |
Chris Mahoney (1684) 2099 posts |
Thanks; I can confirm that VPATH works. Now I just need to step back and figure out whether it’s the best idea in the long run, but that can wait :) |