3

Possible Duplicate:
Common GNU makefile directory path

After reading Recursive Make Considered Harmful I decided to use "include makefile" to my next project. I got a main Makefile that include two sub-makefiles that are in diffrent dirs. the problem is that the paths that inside the sub-makefile is relative to his dir so when I include it from the main Makefile he can't find the files. is there a way to solve this problem without changing the paths?

Community
  • 1
  • 1
Jah
  • 1,019
  • 1
  • 11
  • 25

1 Answers1

1

Although the article is right about recursive make and DAG tree, I read the article about half a year ago and tried to use the approach described in it and found the "classic" approach to recursive make much more convenient. Consider this:

big_project
|--Makefile
|
|--sub_project_1
|  |--...
|  |--Makefile
|
|--sub_project_2
   |--...
   |--Makefile

It's wonderful when you're running make from big_project project directory, but well, if you do things as it's recommended in the article, there would be no Makefiles in sub_project_x directories, thus you won't be able to treat each sub-project separately.

Zaur Nasibov
  • 22,280
  • 12
  • 56
  • 83