bmake: variable modifiers in SysV include
Pietro Cerutti
gahr at FreeBSD.org
Wed Mar 28 11:58:28 UTC 2018
Hi,
our make (contrib/bmake) does not currently support variable modifiers
in SysV-style "include" directives. See this simple example:
==============================================================================
% cat Makefile Makefile1.inc Makefile2.inc Makefile3.inc
# Makefile
SUB= Makefile2.foo Makefile3.foo
include Makefile1.inc $(SUB:.foo=.inc) # ===== THIS =====
# Makefile1.inc
FOO= foo
# Makefile2.inc
BAR= bar
# Makefile3.inc
all:
@echo ${FOO} ${BAR}
% make
make: "/usr/home/gahr/tmp/mk-sysv-include/Makefile" line 5: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/home/gahr/tmp/mk-sysv-include
==============================================================================
This patch [1] corrects this problem, and results in the expected
% make
foo bar
Apart from parentheses reshuffling, the patch just removes a check that
inhibits SysV inclusion if the line being parsed contains a colon (:)
character.
This has been there since bmake has supported SysV includes [2].
Questions:
1. Any ideas why the check is there, and what problem it's preventing?
2. Anybody with src bit would like to approve me committing the fix?
Thanks!
[1] https://people.freebsd.org/~gahr/bmake-inc-subst.diff
[2] http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/parse.c.diff?r1=1.4&r2=1.5
--
Pietro Cerutti
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 898 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20180328/e52bfb43/attachment.sig>
More information about the freebsd-hackers
mailing list