[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1373019377-12741-2-git-send-email-artagnon@gmail.com>
Date: Fri, 5 Jul 2013 15:46:14 +0530
From: Ramkumar Ramachandra <artagnon@...il.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Michael Witten <mfwitten@...il.com>, Ingo Molnar <mingo@...nel.org>
Subject: [PATCH v2 1/4] perf/Makefile: do not open-code shell-sq
d24e473e (perf_counter: copy in Git's top Makefile, 2009-04-20) started
by determining *_SQ variables (shell-quoted equivalents) by calling
subst by hand, with the rationale that $(call) must be avoided to
accommodate ancient setups. That reasoning does not hold true anymore,
as our Makefiles are filled with $(call) invocations now. So, use the
shell-sq function introduced in ced465c4 (perf tools: Makefile:
PYTHON{,_CONFIG} to bandage Python 3 incompatibility, 2011-04-02) in
place of open-coding.
Cc: Michael Witten <mfwitten@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>
Signed-off-by: Ramkumar Ramachandra <artagnon@...il.com>
---
tools/perf/Makefile | 2 +-
tools/perf/config/Makefile | 23 +++++++++++------------
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 203cb0e..ace1784 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -731,7 +731,7 @@ cscope:
$(FIND) . -name '*.[hcS]' -print | xargs cscope -b
### Detect prefix changes
-TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\
+TRACK_CFLAGS = $(call escape-for-shell-sq,$(CFLAGS)):\
$(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f139dcd..3025d87 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -457,21 +457,20 @@ ETC_PERFCONFIG = etc/perfconfig
endif
lib = lib
-# Shell quote (do not use $(call) to accommodate ancient setups);
-ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
-DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
-bindir_SQ = $(subst ','\'',$(bindir))
-mandir_SQ = $(subst ','\'',$(mandir))
-infodir_SQ = $(subst ','\'',$(infodir))
-perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
-template_dir_SQ = $(subst ','\'',$(template_dir))
-htmldir_SQ = $(subst ','\'',$(htmldir))
-prefix_SQ = $(subst ','\'',$(prefix))
-sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
+ETC_PERFCONFIG_SQ = $(call shell-sq,$(ETC_PERFCONFIG))
+DESTDIR_SQ = $(call shell-sq,$(DESTDIR))
+bindir_SQ = $(call shell-sq,$(bindir))
+mandir_SQ = $(call shell-sq,$(mandir))
+infodir_SQ = $(call shell-sq,$(infodir))
+perfexecdir_SQ = $(call shell-sq,$(perfexecdir))
+template_dir_SQ = $(call shell-sq,$(template_dir))
+htmldir_SQ = $(call shell-sq,$(htmldir))
+prefix_SQ = $(call shell-sq,$(prefix))
+sysconfdir_SQ = $(call shell-sq,$(sysconfdir))
ifneq ($(filter /%,$(firstword $(perfexecdir))),)
perfexec_instdir = $(perfexecdir)
else
perfexec_instdir = $(prefix)/$(perfexecdir)
endif
-perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
+perfexec_instdir_SQ = $(call shell-sq,$(perfexec_instdir))
--
1.8.3.1.643.gebeea52.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists