If conditions in a Makefile, inside a target

后端 未结 2 1499
北荒
北荒 2021-01-31 07:13

I\'m trying to setup a Makefile that will search and copy some files (if-else condition) and I can\'t figure out what exactly is wrong with it? (thou I\'m pretty sure it\'s beca

2条回答
  •  温柔的废话
    2021-01-31 07:36

    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 "\" are necessary.

提交回复
热议问题