diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-06-04 12:14:42 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-06-07 10:04:50 -0400 |
commit | 0a2d261d02f4ea6df4a7de0448e431013cf93895 (patch) | |
tree | afbef90f2b30a60d56e29565ab490ce021d9e31a | |
parent | 6dd3579c4892e5ebffbbda5f54c4ba9c55bc64d0 (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-- | Makefile | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -28,10 +28,14 @@ export man_dir man_dir_SQ INSTALL | |||
28 | 28 | ||
29 | ifeq ($(prefix),$(HOME)) | 29 | ifeq ($(prefix),$(HOME)) |
30 | plugin_dir = $(HOME)/.trace-cmd/plugins | 30 | plugin_dir = $(HOME)/.trace-cmd/plugins |
31 | python_dir = $(HOME)/.trace-cmd/python | ||
31 | else | 32 | else |
32 | plugin_dir = $(prefix)/share/trace-cmd/plugins | 33 | plugin_dir = $(prefix)/share/trace-cmd/plugins |
34 | python_dir = $(prefix)/share/trace-cmd/python | ||
33 | PLUGIN_DIR = -DPLUGIN_DIR=$(plugin_dir) | 35 | PLUGIN_DIR = -DPLUGIN_DIR=$(plugin_dir) |
36 | PYTHON_DIR = -DPYTHON_DIR=$(python_dir) | ||
34 | PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))' | 37 | PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))' |
38 | PYTHON_DIR_SQ = '$(subst ','\'',$(PYTHON_DIR))' | ||
35 | endif | 39 | endif |
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 | |||
98 | bindir_SQ = $(subst ','\'',$(bindir)) | 102 | bindir_SQ = $(subst ','\'',$(bindir)) |
99 | bindir_relative_SQ = $(subst ','\'',$(bindir_relative)) | 103 | bindir_relative_SQ = $(subst ','\'',$(bindir_relative)) |
100 | plugin_dir_SQ = $(subst ','\'',$(plugin_dir)) | 104 | plugin_dir_SQ = $(subst ','\'',$(plugin_dir)) |
105 | python_dir_SQ = $(subst ','\'',$(python_dir)) | ||
101 | 106 | ||
102 | LIBS = -L. -ltracecmd -ldl | 107 | LIBS = -L. -ltracecmd -ldl |
103 | LIB_FILE = libtracecmd.a | 108 | LIB_FILE = libtracecmd.a |
@@ -240,7 +245,7 @@ PLUGINS := $(PLUGIN_OBJS:.o=.so) | |||
240 | ALL_OBJS = $(TRACE_CMD_OBJS) $(KERNEL_SHARK_OBJS) $(TRACE_VIEW_MAIN_OBJS) \ | 245 | ALL_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 | ||
243 | CMD_TARGETS = trace_plugin_dir tc_version.h libparsevent.a $(LIB_FILE) \ | 248 | CMD_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 | ||
246 | GUI_TARGETS = ks_version.h trace-graph trace-view kernelshark | 251 | GUI_TARGETS = ks_version.h trace-graph trace-view kernelshark |
@@ -335,8 +340,8 @@ ks_version.h: force | |||
335 | tc_version.h: force | 340 | tc_version.h: force |
336 | $(Q)$(N)$(call update_version.h) | 341 | $(Q)$(N)$(call update_version.h) |
337 | 342 | ||
338 | define update_plugin_dir | 343 | define 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 | |||
346 | endef | 351 | endef |
347 | 352 | ||
348 | trace_plugin_dir: force | 353 | trace_plugin_dir: force |
349 | $(Q)$(N)$(call update_plugin_dir) | 354 | $(Q)$(N)$(call update_dir, 'PLUGIN_DIR=$(PLUGIN_DIR)') |
355 | |||
356 | trace_python_dir: force | ||
357 | $(Q)$(N)$(call update_dir, 'PYTHON_DIR=$(PYTHON_DIR)') | ||
350 | 358 | ||
351 | ## make deps | 359 | ## make deps |
352 | 360 | ||