Re: [PATCH] perf tools: Don't use brace expansion.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bernd Petrovitsch
Date: Tuesday, August 17, 2010 - 9:09 am

On Die, 2010-08-17 at 12:42 -0300, Arnaldo Carvalho de Melo wrote:
[...]

Hmm, that adds that $(OUTPUT)PERF-VERSION-FILE and
$(OUTPUT)common-cmds.h (also) depends on the subdirectories of the other
objects (and thus it works always because at least one of them is a
subdirectory of $(OUTPUT)).
To be 110% anal, it should look like e.g.
+$(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h: $(sort $(dir $(LIB_OBJS) $(BUILTIN_OBJS)) $(OUTPUT))

or actually all targets.


BTW there is no automatic variable or other make-construct to refer in
the dependencies on the own target. Therefore the copy-paste-the-
variables solution.

Perhaps an additional variable reduces clutter (and eases maintenance)?

+# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
+# we depend the various files onto their directories.
+DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
+$(DIRECTORY_DEPS): $(sort $(dir $(DIRECTORY_DEPS)))
+# In the second step, we make a rule to actually create these directories
+$(sort $(dir $(DIRECTORY_DEPS))):
+       mkdir -p $@ 2>/dev/null
+

That should guarantee that all directories from the targets are created.


Ah, I `mkdir`ed the output directory explicitly before the `make` (and
after the `rm -rf`).


BTW which is the preferred tree to base patches on (for the "perf"
subsystem)?

	Bernd
-- 
mobile: +43 664 4416156              http://www.sysprog.at/
    Linux Software Development, Consulting and Services

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] perf tools: Don't use brace expansion., Kusanagi Kouichi, (Mon Aug 16, 5:41 am)
Re: [PATCH] perf tools: Don't use brace expansion., Peter Zijlstra, (Mon Aug 16, 6:30 am)
Re: [PATCH] perf tools: Don't use brace expansion., Bernd Petrovitsch, (Mon Aug 16, 7:09 am)
Re: [PATCH] perf tools: Don't use brace expansion., Peter Zijlstra, (Mon Aug 16, 7:30 am)
Re: [PATCH] perf tools: Don't use brace expansion., Bernd Petrovitsch, (Mon Aug 16, 7:54 am)
Re: [PATCH] perf tools: Don't use brace expansion., Arnaldo Carvalho de Melo, (Mon Aug 16, 8:24 am)
Re: [PATCH] perf tools: Don't use brace expansion., Arnaldo Carvalho de Melo, (Mon Aug 16, 8:29 am)
Re: [PATCH] perf tools: Don't use brace expansion., Bernd Petrovitsch, (Mon Aug 16, 8:43 am)
Re: [PATCH] perf tools: Don't use brace expansion., Arnaldo Carvalho de Melo, (Mon Aug 16, 8:50 am)
Re: [PATCH] perf tools: Don't use brace expansion., Bernd Petrovitsch, (Tue Aug 17, 4:58 am)
Re: [PATCH] perf tools: Don't use brace expansion., Arnaldo Carvalho de Melo, (Tue Aug 17, 8:42 am)
Re: [PATCH] perf tools: Don't use brace expansion., Bernd Petrovitsch, (Tue Aug 17, 9:09 am)
Re: [PATCH] perf tools: Don't use brace expansion., Arnaldo Carvalho de Melo, (Tue Aug 17, 11:16 am)
[tip:perf/urgent] perf tools: Fix build on POSIX shells, tip-bot for Bernd Pe ..., (Wed Aug 18, 1:18 am)
Re: [PATCH] perf tools: Don't use brace expansion., Bernd Petrovitsch, (Wed Aug 18, 2:47 am)