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 $($@)