【问题标题】:Master makefile which runs make files in subdirectories在子目录中运行 make 文件的主 makefile
【发布时间】:2012-09-30 10:25:37
【问题描述】:

如何创建一个makefile,它将启动所有子目录中的所有make 文件。是否可以在主目录上运行“make”主makefile,这将自动触发子目录的make?

示例:

/makefile   (this is the main makefile)
/subdirectory1/makefile
/subdirectory1/various .c/.h files compiled by the makefile in this directory
/subdirectory2/makefile
/subdirectory2/various .c/.h files compiled by the makefile in this directory
/subdirectory3/makefile
/subdirectory3/various .c/.h files compiled by the makefile in this directory

【问题讨论】:

    标签: makefile


    【解决方案1】:

    是的,这很简单。在主生成文件中:

    all:
        $(MAKE) -C subdirectory1
        $(MAKE) -C subdirectory2
        $(MAKE) -C subdirectory3
    

    一旦你把它弄下来,就会有更复杂的变化。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-25
      • 1970-01-01
      • 2019-08-13
      • 2015-06-03
      相关资源
      最近更新 更多