git: mk: Fix ${group}_FLAGS_FILES to support sources with subdirs

Aaron LI aly at crater.dragonflybsd.org
Fri Aug 28 00:23:02 PDT 2026


commit 91d88399d7f8dacc1881074ce5abf3b25c0776d1
Author: Aaron LI <aly at aaronly.me>
Date:   Tue Aug 25 19:18:54 2026 +0800

    mk: Fix ${group}_FLAGS_FILES to support sources with subdirs
    
    Previously ${group}_FLAGS_FILES required bare filenames as the
    per-group flags were propagated into build commands via
    ${_${.IMPSRC:T}_FLAGS}, where the `:T` suffix required the subdirs
    be ignored for the sources. However, this caused the following problems:
    
    * `make depend` on ${group}_FLAGS_FILES will fail when the subdirs of
      the sources are excluded, because `make` will be unable to find them.
    * Ignoring the subdir portion of the sources can make the flags be
      wrongly set for unwanted files in different directories that share a
      same filename.
    
    To fix the above problems, propagate the per-group flags via variables
    that use the target names, which are predictable and includes the
    subdirs that avoid the ambiguity.  In addition, strip the filename
    suffix so the flags apply to all kinds of objects such as *.o, *.po and
    *.So.
    
    Adjust cc120/libbackend/Makefile accordingly.

Summary of changes:
 gnu/usr.bin/cc120/libbackend/Makefile |  2 +-
 share/mk/bsd.dep.mk                   | 10 +++++
 share/mk/bsd.files.mk                 |  6 ---
 share/mk/bsd.hostlib.mk               |  8 ++--
 share/mk/bsd.lib.mk                   | 70 +++++++++++++++++------------------
 share/mk/sys.mk                       | 46 +++++++++++------------
 6 files changed, 73 insertions(+), 69 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/91d88399d7f8dacc1881074ce5abf3b25c0776d1


-- 
DragonFly BSD source repository


More information about the Commits mailing list