Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

all,

I have found that the same Makefile works well in Mac OS X, but does not work in Ubuntu. The snippet is as following:

start:
    @echo $(seperator)
    @if [[ "$(PROJECT)" == "" ]]; then \
         echo " Project powered by CodeMate!"; \
     else \
         echo "  $(PROJECT)"; \
     fi
    @echo $(seperator)

and make complains:

/bin/sh: [[: not found

Any idea?

Cheers,

Li


Updates:

I have changed the above conditional Bash statements to:

if test "$(PROJECT)" = ""; then \

then things work fine. So what is wrong with "[["?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Makefiles use sh by default, not bash.

In Ubuntu sh point to dash, a POSIX compliant and minimalistic shell, not providing the [[ keywork.

share|improve this answer
    
So we should limit the scripts in the Makefile. Thanks! –  Li Dong Jan 14 '12 at 15:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.