Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




11.2 Failure in Make Rules

Since 1992 Posix has required that make must invoke each command with the equivalent of a ‘sh -c’ subshell. However, many make implementations, including BSD make through 2004, use ‘sh -e -c’ instead, and the -e option causes the subshell to exit immediately if a subsidiary simple-command fails. For example, the command ‘touch T; rm -f U’ always attempts to remove U with Posix make, but incompatible make implementations skip the rm if the touch fails. One way to work around this is to reword the affected simple-commands so that they always succeed, e.g., ‘touch T || :; rm -f U’. However, even this approach can run into common bugs in BSD implementations of the -e option of sh and set (see Limitations of Builtins), so if you are worried about porting to buggy BSD shells it may be simpler to migrate complicated make actions into separate scripts.

  Published under the terms of the GNU General Public License Design by Interspire