tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bmake: variable modifiers in SysV include



Hi,

see below my original message to a FreeBSD mailing list, which I'm forwarding here sa per Simon's suggestion.

Anybody with historical memory on SysV-style "include" directive in bmake can shed a light on why an include is prevented if a colon is found in the parsed line?

Thank you,

----- Forwarded message from Pietro Cerutti <gahr%FreeBSD.org@localhost> -----

Date: Wed, 28 Mar 2018 11:58:25 +0000
From: Pietro Cerutti <gahr%FreeBSD.org@localhost>
To: freebsd-hackers%FreeBSD.org@localhost, sjg%FreeBSD.org@localhost
Subject: bmake: variable modifiers in SysV include

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

----- End forwarded message -----

--
Pietro Cerutti

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index