Re: [PATCH 3/3] Makefile: don't use temporary files in generation of dependency files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/2/24 Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>:
> These temporary files were a real problem when creating the Debian
> package for rt-tests.  debhelper (a generic suite of scripts to ease
> packaging) did something like:
>
>        perl -c 'close(STDERR); exec("make distclean");'
>
> which leaked the *.d.$$ files and then wailed that the package contained
> untracked changes to the vanilla source.  See
> http://bugs.debian.org/570443 for some more details.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> ---
>  Makefile |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 99fbba4..5bb8774 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -43,10 +43,7 @@ VPATH        += src/lib
>
>  # Pattern rule to generate dependency files from .c files
>  %.d: %.c
> -       @set -e; rm -f $@; \
> -       $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
> -       sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
> -       rm -f $@.$$$$
> +       @$(CC) -MM $(CFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ || rm -f $@
>
>  .PHONY: all
>  all: $(TARGETS) hwlatdetect
> --
> 1.6.6.2
>

This is fine too, it may even be faster.
Acked-by: John Kacur <jkacur@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux