2012-10-10 2 views
1

Как мне создать файл makefile, который запустит все файлы make во всех подкаталогах. Возможно ли запустить «make» в главном каталоге основного файла makefile, который автоматически активирует 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 

ответ

3

Да, это довольно просто. В основном make-файле:

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

Есть более сложные варианты, как только у вас это будет.

Смежные вопросы