Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jun 2014 07:56:41 +0000
From:      bz-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 191054] New: make clean/cleanobj does not clean as expected with bsd.progs.mk
Message-ID:  <bug-191054-8@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 191054
           Summary: make clean/cleanobj does not clean as expected with
                    bsd.progs.mk
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: yaneurabeya@gmail.com

When trying to isolate some issues with bsd.test.mk, I noticed that make
clean/cleanobj  was not cleaning as expected, in particular make clean does not
clean any of the compiled programs, and make cleanobj only cleans out the last
compiled program. If I run make cleandir, it napalms the heck out of the
directory by deleting the bsd.dep.mk files 6 times (twice for cleandir, twice
for cleanobj, twice for cleandepend) and the generated objects 2 times each
(once each for cleanobj, once each for cleandir).

I've provided an example below:

% uname -a
FreeBSD isilon-fuji-current.local 11.0-CURRENT FreeBSD 11.0-CURRENT #5
0d2be6b(isilon-atf): Sun Jun  8 21:34:32 PDT 2014    
root@fuji-current.local:/usr/obj/usr/src/sys/FUJI  i386
% cat *
# Makefile
FILESDIR=/tmp/share

FILES=    c

BINDIR=    /tmp/bin

PROGS=    a b

MAN=

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

int
main(void)
{

    printf("hello world!\n");
    return (0);
}
/* b.c */
#include <stdio.h>

int
main(void)
{

    printf("hello world!\n");
    return (0);
}
/* c */
This directory contains a simple C app that says, "hello world!"
% make obj
/usr/obj/root/make_clean_broken_with_progs_dot_mk created for
/root/make_clean_broken_with_progs_dot_mk
% make depend
(cd /root/make_clean_broken_with_progs_dot_mk && make -f
/root/make_clean_broken_with_progs_dot_mk/Makefile _RECURSING_PROGS=  SUBDIR=
PROG=a  depend)
rm -f .depend.a
mkdep -f .depend.a -a     -std=gnu99  
/root/make_clean_broken_with_progs_dot_mk/a.c
echo a: /usr/lib/libc.a  >> .depend.a
(cd /root/make_clean_broken_with_progs_dot_mk && make -f
/root/make_clean_broken_with_progs_dot_mk/Makefile _RECURSING_PROGS=  SUBDIR=
PROG=b  depend)
rm -f .depend.b
mkdep -f .depend.b -a     -std=gnu99  
/root/make_clean_broken_with_progs_dot_mk/b.c
echo b: /usr/lib/libc.a  >> .depend.b
% make all
(cd /root/make_clean_broken_with_progs_dot_mk && make -f
/root/make_clean_broken_with_progs_dot_mk/Makefile _RECURSING_PROGS=  SUBDIR=
PROG=a )
cc -O2 -pipe   -std=gnu99 -fstack-protector   -Qunused-arguments -c
/root/make_clean_broken_with_progs_dot_mk/a.c
cc -O2 -pipe   -std=gnu99 -fstack-protector   -Qunused-arguments  -o a a.o 
(cd /root/make_clean_broken_with_progs_dot_mk && make -f
/root/make_clean_broken_with_progs_dot_mk/Makefile _RECURSING_PROGS=  SUBDIR=
PROG=b )
cc -O2 -pipe   -std=gnu99 -fstack-protector   -Qunused-arguments -c
/root/make_clean_broken_with_progs_dot_mk/b.c
cc -O2 -pipe   -std=gnu99 -fstack-protector   -Qunused-arguments  -o b b.o 
% make clean
% make cleanobj
(cd /root/make_clean_broken_with_progs_dot_mk && make -f
/root/make_clean_broken_with_progs_dot_mk/Makefile _RECURSING_PROGS=  SUBDIR=
PROG=a  cleanobj)
(cd /root/make_clean_broken_with_progs_dot_mk && make -f
/root/make_clean_broken_with_progs_dot_mk/Makefile _RECURSING_PROGS=  SUBDIR=
PROG=b  cleanobj)
rm -f b b.o
rm -f .depend.b GPATH GRTAGS GSYMS GTAGS
%  make cleandir
(cd /root/make_clean_broken_with_progs_dot_mk && make -f Makefile
_RECURSING_PROGS=  SUBDIR= PROG=a  cleandepend)
rm -f .depend.a GPATH GRTAGS GSYMS GTAGS
(cd /root/make_clean_broken_with_progs_dot_mk && make -f Makefile
_RECURSING_PROGS=  SUBDIR= PROG=b  cleandepend)
rm -f .depend.b GPATH GRTAGS GSYMS GTAGS
(cd /root/make_clean_broken_with_progs_dot_mk && make -f Makefile
_RECURSING_PROGS=  SUBDIR= PROG=a  cleanobj)
rm -f a a.o
rm -f .depend.a GPATH GRTAGS GSYMS GTAGS
(cd /root/make_clean_broken_with_progs_dot_mk && make -f Makefile
_RECURSING_PROGS=  SUBDIR= PROG=b  cleanobj)
rm -f b b.o
rm -f .depend.b GPATH GRTAGS GSYMS GTAGS
(cd /root/make_clean_broken_with_progs_dot_mk && make -f Makefile
_RECURSING_PROGS=  SUBDIR= PROG=a  cleandir)
rm -f a a.o
rm -f .depend.a GPATH GRTAGS GSYMS GTAGS
(cd /root/make_clean_broken_with_progs_dot_mk && make -f Makefile
_RECURSING_PROGS=  SUBDIR= PROG=b  cleandir)
rm -f b b.o
rm -f .depend.b GPATH GRTAGS GSYMS GTAGS
%

Expected behavior:

- make clean should clean all apps and generated files.
- make cleanobj should just nuke ${.OBJDIR}; it shouldn't have to nuke the
files under ${.OBJDIR} (bsd.obj.mk ensures that requirement is met for
cleanobj).
- make cleandir should does the same thing as cleanobj (why they're separate
targets, I have no idea, but cleanobj isn't advertised in the docs though...).

-- 
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-191054-8>