[apparmor] [patch] rename _clean to pod_clean in Makefiles

Christian Boltz apparmor at cboltz.de
Fri Jan 30 20:21:04 UTC 2015


Hello,

Am Freitag, 30. Januar 2015 schrieb John Johansen:
> On 01/28/2015 01:34 PM, Christian Boltz wrote:
> > since the Makefile cleanup, the _clean target is only used to delete
> > manpages etc. generated from *.pod files.
> 
> is it? Sorry I haven't dug into this yet but from just looking at the
> targets they list a lot more than pod files

No, but it seems you didn't write Makefiles for a while ;-)

> So either we need to cleanup what is being done by these targets or
> we should leave the name at clean, because pod_clean touching lib and
> object files doesn't make any sense
> 
> > This patch renames the target to pod_clean to make it obvious what
> > it
> > does.
> > 
> > 
> > BTW: common/Make.rules uses "-rm -f" which means errors are ignored.
> > What's the reason for doing this? bzr blame isn't too useful - the
> > line was added in r516 (moved into Make.rules from various
> > Makefiles), but all those Makefiles used "rm -f" (without -), and
> > there's no explanation why the - was added.
> > 
> > 
> > 
> > [ Makefiles_pod_clean.diff ]
> > 
> > === modified file 'changehat/mod_apparmor/Makefile'
> > --- changehat/mod_apparmor/Makefile     2015-01-23 23:52:09 +0000
> > +++ changehat/mod_apparmor/Makefile     2015-01-28 21:22:45 +0000
> > @@ -86,7 +86,7 @@
> > 
> >         make install_manpages DESTDIR=${DESTDIR}
> >  
> >  .PHONY: clean
> > 
> > -clean: _clean
> > +clean: pod_clean
> > 
> >         rm -rf .libs
> >         rm -f *.la *.lo *.so *.o *.slo
> 
> some nice library files here

For clean, yes.

Note that the line
    clean: pod_clean
means
- call 'make pod_clean'
- execute everything in the following lines (as long as they start with 
  a tab)

Translated to "normal" (pseudo)code, this would be something like

function clean() {
    pod_clean()
    rm -rf .libs
    rm -f *.la *.lo *.so *.o *.slo
}

> > === modified file 'common/Make.rules'
> > --- common/Make.rules   2015-01-24 00:01:14 +0000
> > +++ common/Make.rules   2015-01-28 21:22:10 +0000
> > @@ -88,11 +88,11 @@
> > 
> >  repo_version:
> >          $(value REPO_VERSION_CMD)
> > 
> > -.PHONY: _clean
> > +.PHONY: pod_clean
> > 
> >  ifndef VERBOSE
> > 
> > -.SILENT: _clean
> > +.SILENT: pod_clean
> > 
> >  endif
> > 
> > -_clean:
> > +pod_clean:
> >         -rm -f ${MANPAGES} *.[0-9].gz ${HTMLMANPAGES} pod2htm*.tmp

This is the actual pod_clean target - I'd say it only deletes files 
created by pod2man or pod2html ;-)


Regards,

Christian Boltz
-- 
Morgen soll ich eine Ente braten, aber vielleicht nehm' ich
ja doch lieber einen Storch? [Tao te Puh in opensuse-de]




More information about the AppArmor mailing list