git: bsd.*.mk: Fix bug when SRCS is explicitly defined empty

John Marino marino at crater.dragonflybsd.org
Tue Jan 27 14:21:17 PST 2015


commit bed2cf9317ac90b133f4347a78a1e4880b6ad761
Author: John Marino <draco at marino.st>
Date:   Tue Jan 27 23:20:44 2015 +0100

    bsd.*.mk: Fix bug when SRCS is explicitly defined empty
    
    There exists a valid possibility of setting a makefile to build a program
    or library exclusively with OBJS defined.  In the case of bsd.prog.mk,
    not defining SRCS will cause the definition of OBJS to be overwritten
    with ${PROG}.c or ${PROG}.cc.  Defining SRCS as an empty list will stop
    OBJS from being overwritten, but there's a bug.  It adds ".o" to the end
    of the list.
    
    For example:
    ======================
    OBJS= first.o second.o
    SRCS=
    .include <bsd.prog.mk>
    ======================
    make -V OBJS
    first.o second.o .o
    
    This is caused by a transformation assuming SRCS has at least one item
    in the list.  It's fixed by only performing the transformation if SRCS
    is not empty.  I'm adding this check to both bsd.prog.mk and bsd.lib.mk

Summary of changes:
 share/mk/bsd.lib.mk  | 2 ++
 share/mk/bsd.prog.mk | 2 ++
 2 files changed, 4 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bed2cf9317ac90b133f4347a78a1e4880b6ad761


-- 
DragonFly BSD source repository



More information about the Commits mailing list