Add silent mode to examples Makefiles
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 20 Dec 2018 20:22:42 +0000 (15:22 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 21 Dec 2018 21:07:19 +0000 (16:07 -0500)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/examples/Makefile.am
doc/examples/clock-override/Makefile
doc/examples/demo-tracef/Makefile
doc/examples/demo-tracelog/Makefile
doc/examples/demo/Makefile
doc/examples/easy-ust/Makefile
doc/examples/gen-tp/Makefile
doc/examples/getcpu-override/Makefile
doc/examples/hello-static-lib/Makefile

index 493e07dd62997b83636f12d9a4267cf43211bc9b..d5d00b090c61acaa194b7a009a448de7286ea205 100644 (file)
@@ -106,28 +106,24 @@ SUBDIRS_PROXY += gen-tp
 endif
 
 all-local:
-       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+       $(AM_V_at)if [ x"$(srcdir)" != x"$(builddir)" ]; then \
                for subdir in $(SUBDIRS_PROXY) $(SUBDIRS_JUL) $(SUBDIRS_LOG4J) $(SUBDIRS_CMAKE); do \
                        cp -pfR $(srcdir)/$$subdir $(builddir); \
                        chmod -R u+w $(builddir)/$$subdir; \
                done; \
        fi; \
        if [ x"$(shell echo "$(top_srcdir)" | grep "^/" | wc -l)" = x"1" ]; then \
-               echo "Examples: absolute top_srcdir path $(top_srcdir)"; \
                rel_src_subdir=""; \
        else \
-               echo "Examples: relative top_srcdir path $(top_srcdir)"; \
                rel_src_subdir="../"; \
        fi; \
        if [ x"$(shell echo "$(top_builddir)" | grep "^/" | wc -l)" = x"1" ]; then \
-               echo "Examples: absolute top_builddir path $(top_builddir)"; \
                rel_build_subdir=""; \
        else \
-               echo "Examples: relative top_builddir path $(top_builddir)"; \
                rel_build_subdir="../"; \
        fi; \
        for subdir in $(SUBDIRS_PROXY); do \
-               (cd $$subdir && $(MAKE) CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" AM_CPPFLAGS="$(AM_CPPFLAGS) -I$$rel_src_subdir$(top_srcdir)/include/ -I$$rel_build_subdir$(top_builddir)/include/" CFLAGS='$(CFLAGS)' AM_CFLAGS='$(AM_CFLAGS)' LDFLAGS="$(LDFLAGS)" AM_LDFLAGS='$(AM_LDFLAGS) -L../../../liblttng-ust/.libs -Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../liblttng-ust/.libs/"' LTTNG_GEN_TP_PATH="../../../tools/" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
+               (cd $$subdir && $(MAKE) CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" AM_CPPFLAGS="$(AM_CPPFLAGS) -I$$rel_src_subdir$(top_srcdir)/include/ -I$$rel_build_subdir$(top_builddir)/include/" CFLAGS='$(CFLAGS)' AM_CFLAGS='$(AM_CFLAGS)' LDFLAGS="$(LDFLAGS)" AM_LDFLAGS='$(AM_LDFLAGS) -L../../../liblttng-ust/.libs -Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../liblttng-ust/.libs/"' LTTNG_GEN_TP_PATH="../../../tools/" AM_V_P="$(AM_V_P)" AM_V_at="$(AM_V_at)" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
        done; \
        if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
                for subdir in $(SUBDIRS_JUL); do \
@@ -162,7 +158,7 @@ all-local:
 
 
 clean-local:
-       @for subdir in $(SUBDIRS_PROXY); do \
+       $(AM_V_at)for subdir in $(SUBDIRS_PROXY); do \
                if [ -d $$subdir ]; then \
                        (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) clean && cd ..) || exit 1; \
                fi; \
index 22e5dffb807812bd5e28444cb04c2ee0dd5582fe..bd29f1794dea3b79c7f139a4428d49866619d724 100644 (file)
 LIBS = -ldl    # On Linux
 #LIBS = -lc    # On BSD
 LOCAL_CPPFLAGS += -I.
+AM_V_P := :
 
 all: lttng-ust-clock-override-example.so
 
 lttng-ust-clock-override-example.o: lttng-ust-clock-override-example.c
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -fpic -c -o $@ $<
 
 lttng-ust-clock-override-example.so: lttng-ust-clock-override-example.o
-       $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
                $(AM_LDFLAGS) $(CFLAGS) -shared -fpic lttng-ust-clock-override-example.o
 
 .PHONY: clean
index 1e4544c41a34542639a001ab53401cc3f21948a4..ee20784335ac00c486fb5d83519e6e5fb0e93d3e 100644 (file)
 LIBS = -ldl -llttng-ust        # On Linux
 #LIBS = -lc    # On BSD
 LOCAL_CPPFLAGS += -I.
+AM_V_P := :
 
 all: demo-tracef
 
 demo-tracef.o: demo-tracef.c
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -c -o $@ $<
 
 demo-tracef: demo-tracef.o
-       $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
                -o $@ $< $(LIBS)
 
 .PHONY: clean
index a16d6c5237d3a05f37fea8c00dc104b90ea8a513..0d9a20aa62f27ba59af9a8f521cc68b33aa02e55 100644 (file)
 LIBS = -ldl -llttng-ust        # On Linux
 #LIBS = -lc    # On BSD
 LOCAL_CPPFLAGS += -I.
+AM_V_P := :
 
 all: demo-tracelog
 
 demo-tracelog.o: demo-tracelog.c
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -c -o $@ $<
 
 demo-tracelog: demo-tracelog.o
-       $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
                -o $@ $< $(LIBS)
 
 .PHONY: clean
index bb7fc17368202b8bfbc5c1fd022c6711a61347fe..b309ef6ed35889cd24809d639e78b9ce36727f59 100644 (file)
 LIBS = -ldl    # On Linux
 #LIBS = -lc    # On BSD
 LOCAL_CPPFLAGS += -I.
+AM_V_P := :
 
 all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so
 
 tp.o: tp.c ust_tests_demo.h
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -fpic -c -o $@ $<
 
 tp2.o: tp2.c ust_tests_demo2.h
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -fpic -c -o $@ $<
 
 lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o
-       $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
                $(AM_LDFLAGS) $(CFLAGS) -shared -fpic tp.o tp2.o $(LIBS) -llttng-ust
 
 tp3.o: tp3.c ust_tests_demo3.h
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -fpic -c -o $@ $<
 
 lttng-ust-provider-ust-tests-demo3.so: tp3.o
-       $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
                $(AM_LDFLAGS) $(CFLAGS) -shared -fpic tp3.o $(LIBS) -llttng-ust
 
 demo.o: demo.c
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -c -o $@ $<
 
 demo: demo.o
-       $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
                -o $@ demo.o $(LIBS)
 
 .PHONY: clean
index 022729389f4a14fe0e032e99720ba3249d5cc266..9e957ccfff88bbc31d55eba800f9b981c222e7d5 100644 (file)
 LIBS = -ldl -llttng-ust                # On Linux
 #LIBS = -lc -llttng-ust                # On BSD
 LOCAL_CPPFLAGS += -I.
+AM_V_P := :
 
 all: sample
 
 sample: sample.o tp.o
-       $(CC) -o $@ $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) -o $@ $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
                sample.o tp.o $(LIBS)
 
 sample.o: sample.c sample_component_provider.h
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -c -o $@ $<
 
 tp.o: tp.c sample_component_provider.h
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -c -o $@ $<
 
 html: sample_component_provider.html sample.html tp.html
index 6d9ec10d5e5dd47f4db4604713c1c8cd50bcafdc..bc172f0ccefbd08830f05a81b225e9594bb72969 100644 (file)
 
 LIBS = -ldl -llttng-ust                #On Linux
 #LIBS = -lc -llttng-ust                #On BSD
+AM_V_P := :
 
 all: sample
 
 sample: sample.o sample_tracepoint.o
-       $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
                -o $@ sample.o sample_tracepoint.o $(LIBS)
 
 sample.o: sample.c sample_tracepoint.h
-       $(CC) $(CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) $(CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) $(CFLAGS) \
                -c -o $@ $<
 
 # Use this command to compile the .c manually
@@ -38,11 +41,12 @@ sample.o: sample.c sample_tracepoint.h
 # This rule generate .o only and depends on rules for generating
 # the .h and .c
 %.o: %.tp %.c %.h
-       CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS)" \
-       CFLAGS="$(AM_CFLAGS) $(CFLAGS)" \
-       LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \
-       CC="$(CC)" \
-       $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS)" \
+               CFLAGS="$(AM_CFLAGS) $(CFLAGS)" \
+               LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \
+               CC="$(CC)" \
+               $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
 
 # The following rule can be used to generate all files instead of having one
 # for each file type. Note that the sample.o has a dependency on the
@@ -51,10 +55,12 @@ sample.o: sample.c sample_tracepoint.h
 #      lttng-gen-tp $<
 
 %.h: %.tp
-       $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
+       @if $(AM_V_P); then set -x; else echo "  GEN      $@"; fi; \
+               $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
 
 %.c: %.tp
-       $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
+       @if $(AM_V_P); then set -x; else echo "  GEN      $@"; fi; \
+               $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
 
 .PHONY: clean
 clean:
index e1e4892c6e1142b418909fb4ed7bdcb68932598f..435b851df04d6d52fdc2be306c3e063b768304a7 100644 (file)
 LIBS = -ldl    # On Linux
 #LIBS = -lc    # On BSD
 LOCAL_CPPFLAGS += -I.
+AM_V_P := :
 
 all: lttng-ust-getcpu-override-example.so
 
 lttng-ust-getcpu-override-example.o: lttng-ust-getcpu-override-example.c
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -fpic -c -o $@ $<
 
 lttng-ust-getcpu-override-example.so: lttng-ust-getcpu-override-example.o
-       $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
                $(AM_LDFLAGS) $(CFLAGS) -shared -fpic lttng-ust-getcpu-override-example.o
 
 .PHONY: clean
index cf72b35d34e720c2ea4bf45a8132ab2a16b9ab92..c5fdd31c4638f466c551d2347054dd92511e8e89 100644 (file)
 LOCAL_CPPFLAGS += -I.
 LIBS = -ldl -llttng-ust        # On Linux
 #LIBS = -lc -llttng-ust        # On BSD
+AM_V_P := :
 
 all: hello
 
 lttng-ust-provider-hello.o: tp.c ust_tests_hello.h
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -c -o $@ $<
 
 lttng-ust-provider-hello.a: lttng-ust-provider-hello.o
-       ar -rc $@ lttng-ust-provider-hello.o
+       @if $(AM_V_P); then set -x; else echo "  AR       $@"; fi; \
+               ar -rc $@ lttng-ust-provider-hello.o
 
 hello.o: hello.c
-       $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CC       $@"; fi; \
+               $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
                $(CFLAGS) -c -o $@ $<
 
 hello: hello.o lttng-ust-provider-hello.a
-       $(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
+       @if $(AM_V_P); then set -x; else echo "  CCLD     $@"; fi; \
+               $(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
                $(CFLAGS) hello.o lttng-ust-provider-hello.a $(LIBS)
 
 .PHONY: clean
This page took 0.032486 seconds and 4 git commands to generate.