3

内部にサブディレクトリを含むディレクトリがあります。ヘッダー ファイルの make ファイルにインクルード パスとして親ディレクトリを含めたい。すべてのサブディレクトリでヘッダー ファイルが検索されるような構文はありますか。

[EDIT] Posting the question in more detail
There are three sub folders in a parent folder
parentFolder/child1
parentFolder/child2
parentFolder/child3

There are header files in each all subfolders

Using -I option in makefile for header file path, i have to use
HEADER_PATH += -I./parentFolder
HEADER_PATH += -I./parentFolder/child1
HEADER_PATH += -I./parentFolder/child2
HEADER_PATH += -I./parentFolder/child3

Is there any way I can mention only the parent folder , but the search for header files will happen in all the subfolders also
4

1 に答える 1

3

http://www.gnu.org/software/make/manual/html_node/Recursion.html

最初のメイクファイルで変数を設定し、サブディレクトリ用にエクスポートします。サブディレクトリで make を手動で呼び出すことができるようにしたい場合 - これを達成する最善の方法は、configure のようなシステムを使用してパスを生成するか、グローバル変数 (例: YOURPROJECT_DIR) を makefiles に設定する.profile.bashrc、makefiles で使用することです。

少し前にまったく同じ問題に遭遇したので、より良い解決策を見たいと思います。

于 2013-10-23T05:39:43.227 に答える