diff mbox series

[4/6] libtracefs: Move source files to new src/ directory

Message ID 20201208215504.757940690@goodmis.org (mailing list archive)
State Accepted
Commit 45b174f4786483a02133e6579f5af19737c2d439
Headers show
Series libtracefs: Clean up of the source directory | expand

Commit Message

Steven Rostedt Dec. 8, 2020, 9:54 p.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

In cleaning up the directory structure, move the C files into their own
"src/" directory.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile                                     | 28 ++++----------------
 tracefs-events.c => src/tracefs-events.c     |  0
 tracefs-instance.c => src/tracefs-instance.c |  0
 tracefs-utils.c => src/tracefs-utils.c       |  0
 4 files changed, 5 insertions(+), 23 deletions(-)
 rename tracefs-events.c => src/tracefs-events.c (100%)
 rename tracefs-instance.c => src/tracefs-instance.c (100%)
 rename tracefs-utils.c => src/tracefs-utils.c (100%)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 5a250eeb03b1..f6b6a9ede5c0 100644
--- a/Makefile
+++ b/Makefile
@@ -267,35 +267,17 @@  all: $(DEFAULT_TARGET)
 $(bdir):
 	@mkdir -p $(bdir)
 
-$(OBJS): | $(bdir)
-$(DEPS): | $(bdir)
-
 LIBS = -L$(obj)/lib/traceevent -ltraceevent
 
-$(LIBTRACEFS_STATIC): $(OBJS)
-	$(Q)$(call do_build_static_lib)
-
-$(LIBTRACEFS_SHARED): $(OBJS)
-	$(Q)$(call do_compile_shared_library)
-	@ln -sf $(@F) $(bdir)/libtracefs.so
-	@ln -sf $(@F) $(bdir)/libtracefs.so.$(TFS_VERSION)
-
-$(bdir)/%.o: %.c
-	$(Q)$(call do_fpic_compile)
-
-$(DEPS): $(bdir)/.%.d: %.c
-	$(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@
+$(LIBTRACEFS_STATIC): force
+	$(Q)$(MAKE) -C $(src)/src $@
 
-$(OBJS): $(bdir)/%.o : $(bdir)/.%.d
-
-dep_includes := $(wildcard $(DEPS))
-
-ifneq ($(dep_includes),)
-  include $(dep_includes)
-endif
+$(bdir)/libtracefs.so.$(TRACEFS_VERSION): force
+	$(Q)$(MAKE) -C $(src)/src $@
 
 clean:
 	$(MAKE) -C $(src)/utest clean
+	$(MAKE) -C $(src)/src clean
 	$(RM) $(TARGETS) $(bdir)/*.a $(bdir)/*.so $(bdir)/*.o $(bdir)/.*.d
 	$(RM) $(PKG_CONFIG_FILE)
 
diff --git a/tracefs-events.c b/src/tracefs-events.c
similarity index 100%
rename from tracefs-events.c
rename to src/tracefs-events.c
diff --git a/tracefs-instance.c b/src/tracefs-instance.c
similarity index 100%
rename from tracefs-instance.c
rename to src/tracefs-instance.c
diff --git a/tracefs-utils.c b/src/tracefs-utils.c
similarity index 100%
rename from tracefs-utils.c
rename to src/tracefs-utils.c