多目录的Makefile

advanced programming in the unix environmen源码中有多个目录,看到其对多个目录如何进行编译,很受用。先Mark一下,备用。

##下面是要编译的目录

DIRS = lib sockets advio call calld daemons datafiles db environ exercises \
    file ipc ipp lock mycat open opend opend.fe open.fe proc pty \
    sess signals std stdio streams termios threadctl threads

##linux下编译,似乎是shell脚本,当i在DIRS中取值时,cd到该目录,然后make -f linux.mk 接着退出

linux:
    for i in $(DIRS); do \
        (cd $$i && $(MAKE) -f linux.mk) || exit 1; \
    done

posted on 2011-05-14 20:19  rfcff  阅读(544)  评论(0编辑  收藏  举报