lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <60fb7c6374e74b6d9e7597b19772209a@AcuMS.aculab.com>
Date:   Mon, 31 May 2021 08:59:52 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Masahiro Yamada' <masahiroy@...nel.org>,
        "patches@....linux.org.uk" <patches@....linux.org.uk>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Linus Walleij" <linus.walleij@...aro.org>,
        Russell King <linux@...linux.org.uk>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH] ARM: simplify the build rule of mach-types.h

From: Masahiro Yamada
> Sent: 28 May 2021 04:49
> 
> The directory of mach-types.h is created a couple of lines above:
> 
>   _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \
> 
> The 'mkdir -p' command is redundant.
(In the rule itself)
...
>  quiet_cmd_gen_mach = GEN     $@
> -      cmd_gen_mach = mkdir -p $(dir $@) && \
> -		     $(AWK) -f $(filter-out $(PHONY),$^) > $@
> +      cmd_gen_mach = $(AWK) -f $(real-prereqs) > $@

There is a much easier way to get directories created.
gmake lets you define dependencies that only need to exist
(ie there file timestamps are't checked)
These are ideal for creating directories.

So if can define:

%/.:
	mkdir -p $@

You can just use

$(OBJ)/$(FILE): | ${OBJ)/.

to get any directories created.

Annoyingly gmake doesn't seem to support the 'dynamic dependencies'
of SYSV make (it's only useful feature).
So you can't use:
xxxxx: | $$@D/.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ