LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 619|回复: 1

Help!! about Makefile?

[复制链接]
发表于 2007-3-22 16:25:47 | 显示全部楼层 |阅读模式
all:
        for i in $(dirs) ; do  make -C $$i || exit $? ; done
clean:
        -for i in $(dirs) ; do \
                [ ! -d $$i ] || make -C $$i clean; \
        done
        rm -f bin/*

install:
        -for i in $(dirs) ; do \
                [ ! -d $$i ] || make -C $$i install; \
        done

at the top of the programme.there are some points making me head bad.
1:  what`s the meaning about [! -d $$i]??
2: whether make -C $$i install  eauals the following :
if the current directory is /usr in which there are some sub-directories and files such as /src; hello.c,Makfile. the Make -C =====  Make  /usr/Makfie??
next run make install. right?
please help me! Thanks.
发表于 2007-3-23 01:24:08 | 显示全部楼层
1. [ ! -d $$i ] means "if $$1 is directory", check bash manual page.
2. $$i is sub-directory in the current directory normally. In your example, $$i might be /usr/src, "make -C $$i install" will do "cd /usr/src; make install", which means make will run target install in /usr/src/Makefile, not in /usr/Makefile.

Hope it was clear.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表