MakeFile错误::此时-d是意外的

时间:2014-01-02 16:41:04

标签: makefile

我收到错误消息:

  

-d此时出乎意料

运行以下内容时(请参阅第3行:if [-d ".git"]

autoversion:
    @( \
    if [ -d ".git" ] && which git > /dev/null ; then \
        DETECTED_VERSION=$$(git describe --always --tags --dirty) ; \
    else \
        DETECTED_VERSION=$$(grep -v "^#" "$(RELEASED_VERSION_FILE)") ; \
        if basename $$(pwd) | grep -q "^[[:alnum:]]*-bedtools-[[:alnum:]]*$$" ; then \
            DETECTED_VERSION=$${DETECTED_VERSION}-zip-$$(basename "$$(pwd)" | sed 's/^[[:alnum:]]*-bedtools-//') ; \
        fi ; \
    fi ; \
    \
    CURRENT_VERSION="" ; \
    [ -e "$(VERSION_FILE)" ] && CURRENT_VERSION=$$(grep "define VERSION_GIT " "$(VERSION_FILE)" | cut -f3 -d" " | sed 's/"//g') ; \
    \
    echo "DETECTED_VERSION = $$DETECTED_VERSION" ; \
    echo "CURRENT_VERSION  = $$CURRENT_VERSION" ; \
    if [ "$${DETECTED_VERSION}" != "$${CURRENT_VERSION}" ] ; then \
        echo "Updating version file." ; \
        echo "#ifndef VERSION_GIT_H" > $(VERSION_FILE) ; \
        echo "#define VERSION_GIT_H" >> $(VERSION_FILE) ; \
        echo "#define VERSION_GIT \"$${DETECTED_VERSION}\"" >> $(VERSION_FILE) ; \
        echo "#endif /* VERSION_GIT_H */" >> $(VERSION_FILE) ; \
    fi )

有什么问题?

0 个答案:

没有答案