From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnout Vandecappelle Date: Thu, 20 Oct 2011 00:32:56 +0200 Subject: [Buildroot] [PATCH 1 of 5] Makefile.package.in: add utility functions find*clauses and notfirstword In-Reply-To: <31ae7a6eaff4e2cf9a1e.1318602116@devws108> References: <31ae7a6eaff4e2cf9a1e.1318602116@devws108> Message-ID: <201110200032.56871.arnout@mind.be> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net On Wednesday 19 October 2011 09:34:04, Thomas De Schampheleire wrote: > +# findfileclauses_cont: creates "-o -name 'X' -o -name 'Y'" > +# [1:namelist, 2:prefix] > +findfileclauses_cont=$(patsubst %,$(2) -name '%',$(1)) > +# findfileclauses: creates "-name 'X' -o -name 'Y'" > +# [1:namelist] > +findfileclauses=$(call findfileclauses_cont,$(firstword $(1))) $(call findfileclauses_cont,$(call notfirstword,$(1)),-o) The _cont function is a bit redundant, no? findfileclauses=-name '$(firstword $(1))' $(patsubst %,-o -name '%',$(call notfirstword,$(1))) I don't think the duplication of -name warrants the additional function call. It definitely doesn't make it easier to understand. Nevertheless, this is a nifty patch! Regards, Arnout -- Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 31BB CF53 8660 6F88 345D 54CC A836 5879 20D7 CF43