aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorVladislav Valtchev (VMware) <vladislav.valtchev@gmail.com>2018-02-06 10:48:53 +0200
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-11-20 12:09:00 -0500
commitc20711650fbd79c2811599a975234ae40e8db524 (patch)
tree4fc0795c3faf0da37ab719dc98a5b5f265ff1fec /scripts
parent1906a857d7147100fbdf666a4fedf20221642303 (diff)
downloadlibtracefs-c20711650fbd79c2811599a975234ae40e8db524.tar.gz
trace-cmd: Move plugin_* files in plugins/
This patch moves the source files of all plugins to a dedicated directory, as part of a bigger restructuring plan of trace-cmd's code base. The build system has been updated to support this new directory structure by adding a separate Makefile in plugins/ and by making the parent Makefile to invoke it. Signed-off-by: Vladislav Valtchev (VMware) <vladislav.valtchev@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/utils.mk32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/utils.mk b/scripts/utils.mk
index abfe115..31fc9e9 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -62,6 +62,13 @@ do_plugin_build = \
($(print_plugin_build) \
$(CC) $(CFLAGS) $(LDFLAGS) -shared -nostartfiles -o $@ $<)
+do_compile_python_plugin_obj = \
+ ($(print_plugin_obj_compile) \
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$@) $(PYTHON_INCLUDES) -fPIC -o $@ $<)
+
+do_python_plugin_build = \
+ ($(print_plugin_build) \
+ $(CC) $< -shared $(LDFLAGS) $(PYTHON_LDFLAGS) -o $@)
define make_version.h
(echo '/* This file is automatically generated. Do not modify. */'; \
@@ -83,3 +90,28 @@ define update_version.h
fi);
endef
+define update_dir
+ (echo $1 > $@.tmp; \
+ if [ -r $@ ] && cmp -s $@ $@.tmp; then \
+ rm -f $@.tmp; \
+ else \
+ echo ' UPDATE $@'; \
+ mv -f $@.tmp $@; \
+ fi);
+endef
+
+define do_install
+ $(print_install) \
+ if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
+ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
+ fi; \
+ $(INSTALL) $1 '$(DESTDIR_SQ)$2'
+endef
+
+define do_install_data
+ $(print_install) \
+ if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
+ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
+ fi; \
+ $(INSTALL) -m 644 $1 '$(DESTDIR_SQ)$2'
+endef