equivalent of pipefail in GNU make?

后端 未结 3 1540
失恋的感觉
失恋的感觉 2021-02-12 12:04

Say I have the following files:

buggy_program:

#!/bin/sh
echo \"wops, some bug made me exit with failure\"
exit 1

Makefile:

<         


        
3条回答
  •  别跟我提以往
    2021-02-12 12:46

    You could do:

    SHELL=/bin/bash
    
    .DELETE_ON_ERROR:
    file.gz:
        set -o pipefail; buggy_program | gzip -9 -c >$@
    

    but this only work with bash.

提交回复
热议问题