diff mbox series

[3/9] libtracefs: Fix sample intermediate build targets

Message ID 20211217004214.16074-4-rostedt@goodmis.org (mailing list archive)
State Superseded
Headers show
Series libtracefs: Updates to the Makefile | expand

Commit Message

Steven Rostedt Dec. 17, 2021, 12:42 a.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The target for compiling from *.c to *.o in the samples directory had:

  $(bdir)/%.o: %.c

But since the *.c files were extracted, they already included the $(bdir)
in the name, so the above was really matching: $(bdir)/$(bdir)/*.c and not
being used. Remove the extra $(bdir) from the target.

This also exposed a bug that $(CFLAGS) was not included, and the stream.c
failed to build because of the lacking -D_GNU_SOURCE.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 samples/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/samples/Makefile b/samples/Makefile
index 6ee57fecacbd..2d0d2397c5b4 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -60,10 +60,10 @@  $(EXAMPLES): $(patsubst %,$(bdir)/%,$(TARGETS))
 ## name, and the file will not be discarded by make.
 #
 # $(bdir)/XX.o: $(bdir)/XX.c
-#	$(CC) -g -Wall -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES)
+#	$(CC) -g -Wall $(CFLAGS) -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES)
 
-$(bdir)/%.o: %.c
-	$(CC) -g -Wall -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES)
+%.o: %.c
+	$(CC) -g -Wall $(CFLAGS) -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES)
 
 clean:
 	$(RM) $(bdir)/*