If conditions in a Makefile, inside a target

You can simply use shell commands. If you want to suppress echoing the output, use the “@” sign. For example:

clean:
    @if [ "test" = "test" ]; then\
        echo "Hello world";\
    fi

Note that the closing ; and \ at each line are necessary

(This is because make interpret each line as a seperate command unless it ends with \)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)