makefile 编译指定目录

makefile 编译指定目录

 1 sub1=test1
 2 sub2=test2
 3 subs = sub1 sub2
 4 SUBDIRS =$(foreach i, $(subs), $($(i)))  
 5 .PHONY:default all clean $(SUBDIRS) $(subs)
 6 default:all
 7 
 8 all clean:
 9     make $(SUBDIRS) TARGET=$@
10 $(SUBDIRS):
11     make -C $@ $(TARGET)
12 $(subs):
13     make  $($@) 

 

posted @ 2017-03-11 10:38  catgatp  阅读(5303)  评论(0编辑  收藏  举报