summaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 07:26:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 07:26:15 +0000
commitc72e01b9ea891fa5cbbbe9876bdfb49079b55be7 (patch)
tree44c55a81a281a6c211745c0abc68352aeaf0180f /src/Makefile
parentInitial commit. (diff)
downloadlibtracefs-c72e01b9ea891fa5cbbbe9876bdfb49079b55be7.tar.xz
libtracefs-c72e01b9ea891fa5cbbbe9876bdfb49079b55be7.zip
Adding upstream version 1.6.4.upstream/1.6.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/Makefile62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..e2965bc
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: LGPL-2.1
+
+include $(src)/scripts/utils.mk
+
+OBJS =
+OBJS += tracefs-utils.o
+OBJS += tracefs-instance.o
+OBJS += tracefs-events.o
+OBJS += tracefs-tools.o
+OBJS += tracefs-marker.o
+OBJS += tracefs-kprobes.o
+OBJS += tracefs-hist.o
+OBJS += tracefs-filter.o
+OBJS += tracefs-dynevents.o
+OBJS += tracefs-eprobes.o
+OBJS += tracefs-uprobes.o
+OBJS += tracefs-record.o
+
+# Order matters for the the three below
+OBJS += sqlhist-lex.o
+OBJS += sqlhist.tab.o
+OBJS += tracefs-sqlhist.o
+
+OBJS := $(OBJS:%.o=$(bdir)/%.o)
+
+$(LIBTRACEFS_STATIC): $(OBJS)
+ $(Q)$(call do_build_static_lib)
+
+$(LIBTRACEFS_SHARED): $(OBJS)
+ $(Q)$(call do_compile_shared_library,$(notdir $(LIBTRACEFS_SHARED_VERSION)))
+
+$(LIBTRACEFS_SHARED_VERSION): $(LIBTRACEFS_SHARED)
+ @ln -sf $(<F) $@
+
+$(LIBTRACEFS_SHARED_SO): $(LIBTRACEFS_SHARED_VERSION)
+ @ln -sf $(<F) $@
+
+libtracefs.so: $(LIBTRACEFS_SHARED_SO)
+
+# bison will create both sqlhist.tab.c and sqlhist.tab.h
+sqlhist.tab.h:
+sqlhist.tab.c: sqlhist.y sqlhist.tab.h
+ bison --debug -v --report-file=bison.report -d -o $@ $<
+
+sqlhist-lex.c: sqlhist.l sqlhist.tab.c
+ flex -o $@ $<
+
+$(bdir)/%.o: %.c
+ $(Q)$(call do_fpic_compile)
+
+tracefs-sqlhist.o: sqlhist.tab.h
+
+$(OBJS): | $(bdir)
+
+clean:
+ $(Q)$(call do_clean,$(OBJS) .*.d)
+
+-include .*.d
+
+$(bdir)/tracefs-sqlhist.o tracefs-sqlhist.o: sqlhist.tab.h
+
+.PHONY: $(LIBTRACEFS_SHARED_SO) $(LIBTRACEFS_STATIC)