Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jun 2014 08:51:48 +0000
From:      bz-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 191056] New: bsd.progs.mk: bsd.prog.mk incompatibilities with variables being set and not set
Message-ID:  <bug-191056-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191056

            Bug ID: 191056
           Summary: bsd.progs.mk: bsd.prog.mk incompatibilities with
                    variables being set and not set
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: misc
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: yaneurabeya@gmail.com

There are some values where, if unset in bsd.prog.mk, would default to the
<PROG>.<appropriate.extension>. For instance if I had a Makefile that defined a
program a, like so...

% cat *
# Makefile
PROG= a

.include <bsd.prog.mk>
/* a.c */
#include <stdio.h>

int
main(void) {

    printf("hello world\n");
    return (0);
}
% make all
Warning: Object directory not changed from original /root/make_tests/prog_mk
cc -O2 -pipe   -std=gnu99 -fstack-protector   -Qunused-arguments -c a.c
cc -O2 -pipe   -std=gnu99 -fstack-protector   -Qunused-arguments  -o a a.o 
make: don't know how to make a.1. Stop

make: stopped in /root/make_tests/prog_mk
%

As shown above, bsd.prog.mk automatically assumes that there was a
corresponding source file for ;a' called 'a.c', and there's a manpage a.1.

bsd.progs.mk doesn't maintain this compatibility because it passes through
several variables with empty values instead of not passing them through in the
first place. Example:

% cat *
# Makefile
PROGS=    a

.include <bsd.progs.mk>
/* a.c */
#include <stdio.h>

int
main(void)
{

    printf("hello world!\n");
    return (0);
}
% make all
(cd /root/make_tests/progs_mk && make -f Makefile _RECURSING_PROGS=  SUBDIR=
PROG=a )
Warning: Object directory not changed from original /root/make_tests/progs_mk
make[1]: don't know how to make .o. Stop

make[1]: stopped in /root/make_tests/progs_mk
*** Error code 2

Stop.
make: stopped in /root/make_tests/progs_mk

Expected result:

- The following variables should not be passed through if they aren't set:
-- BINDIR
-- MAN
-- SRCS

There might be more, but these are definite issues that I've found when testing
out bsd.progs.mk over the past couple months.

My diff against bsd.progs.mk is attached as a reference for how I "fixed" the
problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-191056-8>