[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
semicolon effects
From: |
Dan Jacobson |
Subject: |
semicolon effects |
Date: |
Mon, 26 Apr 2021 06:25:24 +0800 |
(info "(make) Rule Syntax") says
The first recipe line may appear on the line after the
prerequisites, with a tab character, or may appear on the same line,
with a semicolon. Either way, the effect is the same.
However,
$ cat Makefile
B:; :; Z
C:
:
Z
$ make B
:; Z
/bin/sh: line 1: Z: command not found
make: *** [Makefile:2: B] Error 127
$ make C
:
Z
make: Z: No such file or directory
make: *** [Makefile:5: C] Error 127
So we see that "the effect is the same" is inaccurate.
And even if we do
$ touch Z
the results don't change.
Sure, $PWD is not on our $PATH, but still, make is using the simple
$ cat x
cat: x: No such file or directory
type response, When it should instead say like
$ x
bash: x: command not found
GNU Make 4.3
- semicolon effects,
Dan Jacobson <=