There seems to be some unreliability in parsing $(if ...)
Here's a bug where I have an extra parenthesis after my $(if ...), and it
causes a coredump [on BSD, Linux, and SGI compiles of gmake-3.78.1]
I've also seen $(if $(filter ...) ...) incorrectly filter, and $(if $(strip
...)) coredump, even when parentheses _are_ properly balanced, [but I'm
having problems recreate those right now].
I include two makefiles which fail below, since one of them only fails when
the target file doesn't exist, and the other one fails in both cases. Odd.
Jonathan
> rm foo
rm: foo: No such file or directory
> gmake -f Makefile2 foo
Bus error (core dumped)
> gmake -f Makefile3 foo
Bus error (core dumped)
> touch foo
> gmake -f Makefile2 foo
echo foo
foo
false)
Syntax error: ")" unexpected
gmake: *** [foo] Error 2
> gmake -f Makefile3 foo
Bus error (core dumped)
> gmake --version
GNU Make version 3.78.1, by Richard Stallman and Roland McGrath.
Built for i386--freebsd2.2.6
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Report bugs to <[EMAIL PROTECTED]>.
> cat Makefile2
#!gmake
USESUBFILES = $(wildcard */$1)
DOCOPYFILE = $(if $(call USESUBFILES, $1), false, true))
foo: force
echo $@
$(call DOCOPYFILE,$@)
force: ;
> cat Makefile3
#!gmake
USESUBFILES = $(wildcard */$1)
foo: force
echo $@
$(if $(call USESUBFILES, asdf), false, true))
force: ;