[PATCH 13/30] perf build: Add gtk objects building

From: Jiri Olsa
Date: Fri Jan 02 2015 - 10:42:10 EST


Move the gtk objects building under build framework.

Add new gtk build object so it's separated from
the rest of the code and could be librarized.

Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Alexis Berlemont <alexis.berlemont@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
---
tools/perf/Build | 2 ++
tools/perf/Build.include | 3 ++-
tools/perf/Makefile.perf | 17 +++++------------
tools/perf/config/Makefile | 1 +
tools/perf/ui/gtk/Build | 9 +++++++++
5 files changed, 19 insertions(+), 13 deletions(-)
create mode 100644 tools/perf/ui/gtk/Build

diff --git a/tools/perf/Build b/tools/perf/Build
index e84ced325147..a9ff8fd0bff9 100644
--- a/tools/perf/Build
+++ b/tools/perf/Build
@@ -35,3 +35,5 @@ CFLAGS_builtin-timechart.o += $(paths)
libperf-y += util/
libperf-y += arch/
libperf-y += ui/
+
+gtk-y += ui/gtk/
diff --git a/tools/perf/Build.include b/tools/perf/Build.include
index a3f325397fc7..6a990b018e6d 100644
--- a/tools/perf/Build.include
+++ b/tools/perf/Build.include
@@ -70,5 +70,6 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
# - depfile generation
# - global $(CFLAGS)
# - per target C flags
+# - per object C flags
# - BUILD_STR macro to allow '-D"$(variable)"' constructs
-c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o)
+c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 64836605a116..686e28073898 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -341,14 +341,7 @@ endif

ifndef NO_GTK2
ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so
-
- GTK_OBJS += $(OUTPUT)ui/gtk/browser.o
- GTK_OBJS += $(OUTPUT)ui/gtk/hists.o
- GTK_OBJS += $(OUTPUT)ui/gtk/setup.o
- GTK_OBJS += $(OUTPUT)ui/gtk/util.o
- GTK_OBJS += $(OUTPUT)ui/gtk/helpline.o
- GTK_OBJS += $(OUTPUT)ui/gtk/progress.o
- GTK_OBJS += $(OUTPUT)ui/gtk/annotate.o
+ GTK_IN := $(OUTPUT)gtk-in.o

install-gtk: $(OUTPUT)libperf-gtk.so
$(call QUIET_INSTALL, 'GTK UI') \
@@ -417,10 +410,10 @@ $(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) $(PERF_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \
$(BUILTIN_OBJS) $(PERF_IN) $(LIBS) -o $@

-$(GTK_OBJS): $(OUTPUT)%.o: %.c $(LIB_H)
- $(QUIET_CC)$(CC) -o $@ -c -fPIC $(CFLAGS) $(GTK_CFLAGS) $<
+$(GTK_IN): FORCE
+ @$(MAKE) $(build)=gtk

-$(OUTPUT)libperf-gtk.so: $(GTK_OBJS) $(PERFLIBS)
+$(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS)
$(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS)

$(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
@@ -700,7 +693,7 @@ config-clean:
@$(MAKE) -C config/feature-checks clean >/dev/null

clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean
- $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
+ $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS)
@find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM)
@$(RM) .config-detected
$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index db4957af8569..b1320ef2ca9b 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -839,3 +839,4 @@ $(call detected_var,mandir_SQ)
$(call detected_var,ETC_PERFCONFIG_SQ)
$(call detected_var,prefix_SQ)
$(call detected_var,LIBDIR)
+$(call detected_var,GTK_CFLAGS)
diff --git a/tools/perf/ui/gtk/Build b/tools/perf/ui/gtk/Build
new file mode 100644
index 000000000000..ec22e899a224
--- /dev/null
+++ b/tools/perf/ui/gtk/Build
@@ -0,0 +1,9 @@
+CFLAGS_gtk += -fPIC $(GTK_CFLAGS)
+
+gtk-y += browser.o
+gtk-y += hists.o
+gtk-y += setup.o
+gtk-y += util.o
+gtk-y += helpline.o
+gtk-y += progress.o
+gtk-y += annotate.o
--
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/