aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-06-04 12:14:42 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-06-07 10:04:50 -0400
commit0a2d261d02f4ea6df4a7de0448e431013cf93895 (patch)
treeafbef90f2b30a60d56e29565ab490ce021d9e31a
parent6dd3579c4892e5ebffbbda5f54c4ba9c55bc64d0 (diff)
build: Make a python directory to install to
Add a python directory under the share/trace-cmd/ directory that can store the libraries needed for PYTHONDIR. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 38d5235..db270ac 100644
--- a/Makefile
+++ b/Makefile
@@ -28,10 +28,14 @@ export man_dir man_dir_SQ INSTALL
28 28
29ifeq ($(prefix),$(HOME)) 29ifeq ($(prefix),$(HOME))
30plugin_dir = $(HOME)/.trace-cmd/plugins 30plugin_dir = $(HOME)/.trace-cmd/plugins
31python_dir = $(HOME)/.trace-cmd/python
31else 32else
32plugin_dir = $(prefix)/share/trace-cmd/plugins 33plugin_dir = $(prefix)/share/trace-cmd/plugins
34python_dir = $(prefix)/share/trace-cmd/python
33PLUGIN_DIR = -DPLUGIN_DIR=$(plugin_dir) 35PLUGIN_DIR = -DPLUGIN_DIR=$(plugin_dir)
36PYTHON_DIR = -DPYTHON_DIR=$(python_dir)
34PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))' 37PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))'
38PYTHON_DIR_SQ = '$(subst ','\'',$(PYTHON_DIR))'
35endif 39endif
36 40
37# copy a bit from Linux kbuild 41# copy a bit from Linux kbuild
@@ -98,6 +102,7 @@ export prefix bindir src obj
98bindir_SQ = $(subst ','\'',$(bindir)) 102bindir_SQ = $(subst ','\'',$(bindir))
99bindir_relative_SQ = $(subst ','\'',$(bindir_relative)) 103bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
100plugin_dir_SQ = $(subst ','\'',$(plugin_dir)) 104plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
105python_dir_SQ = $(subst ','\'',$(python_dir))
101 106
102LIBS = -L. -ltracecmd -ldl 107LIBS = -L. -ltracecmd -ldl
103LIB_FILE = libtracecmd.a 108LIB_FILE = libtracecmd.a
@@ -240,7 +245,7 @@ PLUGINS := $(PLUGIN_OBJS:.o=.so)
240ALL_OBJS = $(TRACE_CMD_OBJS) $(KERNEL_SHARK_OBJS) $(TRACE_VIEW_MAIN_OBJS) \ 245ALL_OBJS = $(TRACE_CMD_OBJS) $(KERNEL_SHARK_OBJS) $(TRACE_VIEW_MAIN_OBJS) \
241 $(TRACE_GRAPH_MAIN_OBJS) $(TCMD_LIB_OBJS) $(PLUGIN_OBJS) 246 $(TRACE_GRAPH_MAIN_OBJS) $(TCMD_LIB_OBJS) $(PLUGIN_OBJS)
242 247
243CMD_TARGETS = trace_plugin_dir tc_version.h libparsevent.a $(LIB_FILE) \ 248CMD_TARGETS = trace_plugin_dir trace_python_dir tc_version.h libparsevent.a $(LIB_FILE) \
244 trace-cmd $(PLUGINS) $(BUILD_PYTHON) 249 trace-cmd $(PLUGINS) $(BUILD_PYTHON)
245 250
246GUI_TARGETS = ks_version.h trace-graph trace-view kernelshark 251GUI_TARGETS = ks_version.h trace-graph trace-view kernelshark
@@ -335,8 +340,8 @@ ks_version.h: force
335tc_version.h: force 340tc_version.h: force
336 $(Q)$(N)$(call update_version.h) 341 $(Q)$(N)$(call update_version.h)
337 342
338define update_plugin_dir 343define update_dir
339 (echo 'PLUGIN_DIR=$(PLUGIN_DIR)' > $@.tmp; \ 344 (echo $1 > $@.tmp; \
340 if [ -r $@ ] && cmp -s $@ $@.tmp; then \ 345 if [ -r $@ ] && cmp -s $@ $@.tmp; then \
341 rm -f $@.tmp; \ 346 rm -f $@.tmp; \
342 else \ 347 else \
@@ -346,7 +351,10 @@ define update_plugin_dir
346endef 351endef
347 352
348trace_plugin_dir: force 353trace_plugin_dir: force
349 $(Q)$(N)$(call update_plugin_dir) 354 $(Q)$(N)$(call update_dir, 'PLUGIN_DIR=$(PLUGIN_DIR)')
355
356trace_python_dir: force
357 $(Q)$(N)$(call update_dir, 'PYTHON_DIR=$(PYTHON_DIR)')
350 358
351## make deps 359## make deps
352 360