rmyorston / pdpmake

Public domain POSIX make
https://frippery.org/make
Other
103 stars 10 forks source link

Conformance issue with the -k implementation #35

Closed nmeum closed 7 months ago

nmeum commented 7 months ago

Consider the following Makefile:

all: foo bar baz

foo:
    @echo foo
    @echo no error

bar:
    @false
    @echo error here

baz:
    @echo baz
    @echo something

If my reading of POSIX is correct, I would have expected the output of make -k to be:

foo
no error
baz
something

Explanation: The first command of the bar target fails (no further commands of the bar target should be run). However, due to -k the baz target should still be executed as it does not depend on the bar target. Without -k, only the output of the foo target should be visible.

Unfortunately, with current Git HEAD (8ef8f88a00e5a755af63873149db92e193c2b3a0) pdpmake -k produces the following output:

foo
no error
make: (Makefile:8): failed to build 'bar'
error here
baz
something

That is, pdpmake still executes the second command of the bar target. I believe this to be incorrect as -k does not imply -i and—in fact—this is also in contrast to the output produced by GNU make and BSD make.

P.S.: I think the failed to build 'bar' message should also be written to stderr instead of stdout.

rmyorston commented 7 months ago

Thanks for the report. Please try the latest HEAD.

nmeum commented 7 months ago

Yep, it's fixed now. Thanks!