aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-01-08 14:53:38 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-08 14:53:38 -0500
commit425ffe3314a66fc335736249717b3641c5590f55 (patch)
treea264216033301c6994fc528dbaa97cda6ed2fbfe
parent1c220f61773e19f5a8aaefcff365dde738228a4e (diff)
kernel-shark: Make the gui build by 'make gui'
Have the gui built with 'make gui'. This allows for those that don't care about the gui to just build the command line (by default). Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--Makefile27
1 files changed, 24 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0a66cbb..125cb8b 100644
--- a/Makefile
+++ b/Makefile
@@ -7,11 +7,13 @@ LIBS = -L. -ltracecmd -ldl
7 7
8PACKAGES= gtk+-2.0 8PACKAGES= gtk+-2.0
9 9
10ifeq ($(BUILDGUI), 1)
10CONFIG_FLAGS = $(shell pkg-config --cflags $(PACKAGES)) \ 11CONFIG_FLAGS = $(shell pkg-config --cflags $(PACKAGES)) \
11 -DGTK_VERSION=$(shell pkg-config --modversion gtk+-2.0 | \ 12 -DGTK_VERSION=$(shell pkg-config --modversion gtk+-2.0 | \
12 awk 'BEGIN{FS="."}{ a = ($$1 * (2^16)) + $$2 * (2^8) + $$3; printf ("%d", a);}') 13 awk 'BEGIN{FS="."}{ a = ($$1 * (2^16)) + $$2 * (2^8) + $$3; printf ("%d", a);}')
13 14
14CONFIG_LIBS = $(shell pkg-config --libs $(PACKAGES)) 15CONFIG_LIBS = $(shell pkg-config --libs $(PACKAGES))
16endif
15 17
16CFLAGS = -g -Wall $(CONFIG_FLAGS) 18CFLAGS = -g -Wall $(CONFIG_FLAGS)
17 19
@@ -21,10 +23,22 @@ CFLAGS = -g -Wall $(CONFIG_FLAGS)
21PLUGINS = plugin_hrtimer.so plugin_mac80211.so plugin_sched_switch.so \ 23PLUGINS = plugin_hrtimer.so plugin_mac80211.so plugin_sched_switch.so \
22 plugin_kmem.so 24 plugin_kmem.so
23 25
24TARGETS = libparsevent.a libtracecmd.a trace-cmd $(PLUGINS) \ 26CMD_TARGETS = libparsevent.a libtracecmd.a trace-cmd $(PLUGINS)
25 trace-graph trace-view kernelshark
26 27
27all: $(TARGETS) 28GUI_TARGETS = trace-graph trace-view kernelshark
29
30###
31# Default we just build trace-cmd
32#
33# If you want kernelshark, then do: make gui
34###
35
36all: $(CMD_TARGETS)
37
38gui: $(CMD_TARGETS)
39 $(MAKE) BUILDGUI=1 all_gui
40
41all_gui: $(GUI_TARGETS)
28 42
29LIB_FILE = libtracecmd.a 43LIB_FILE = libtracecmd.a
30 44
@@ -55,9 +69,16 @@ trace-view:: trace-view-main.o $(TRACE_VIEW_OBJS)
55trace-graph:: trace-graph-main.o trace-graph.o trace-compat.o trace-hash.o trace-filter.o 69trace-graph:: trace-graph-main.o trace-graph.o trace-compat.o trace-hash.o trace-filter.o
56 $(CC) $^ -rdynamic -o $@ $(CONFIG_LIBS) $(LIBS) 70 $(CC) $^ -rdynamic -o $@ $(CONFIG_LIBS) $(LIBS)
57 71
72ifeq ($(BUILDGUI), 1)
58kernelshark:: kernel-shark.o trace-compat.o $(TRACE_VIEW_OBJS) trace-graph.o \ 73kernelshark:: kernel-shark.o trace-compat.o $(TRACE_VIEW_OBJS) trace-graph.o \
59 trace-hash.o 74 trace-hash.o
60 $(CC) $^ -rdynamic -o $@ $(CONFIG_LIBS) $(LIBS) 75 $(CC) $^ -rdynamic -o $@ $(CONFIG_LIBS) $(LIBS)
76else
77kernelshark: force
78 @echo '**************************************'
79 @echo '** To build kernel shark: make gui **'
80 @echo '**************************************'
81endif
61 82
62.PHONY: gtk_depends 83.PHONY: gtk_depends
63view_depends: 84view_depends: