]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: makefile: make the output of the "opts" target more readable
authorWilly Tarreau <w@1wt.eu>
Thu, 11 Apr 2024 15:20:42 +0000 (17:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Apr 2024 15:33:28 +0000 (17:33 +0200)
"make opts" is nice because it shows all options being used, but it
does so in a copy-pastable way that aggregates everything on a single
line, rendering very poorly and making it hard to spot the relevant
variables.

Let's break lines and append a trailing backslash to them instead. This
gives something much more readable which remains copy-pastable. Options
can be inspected and more easily replicated. It was also verified that
copy-pasting the whole block after "make" does continue to work like
before and produces the same output.

Makefile

index 2ee256f7df0ffc24db91ea690359bc270001918a..6417c69c140724a7b6e19c5ac704e88275b2f191 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1168,31 +1168,30 @@ update-version:
 # settings are also listed if they're explicitly set on the command line, or if
 # they are not empty. Implicit "USE_*" are not listed.
 opts:
-       @echo -n 'Using: '
-       @echo -n 'TARGET="$(strip $(TARGET))" '
-       @echo -n 'ARCH="$(strip $(ARCH))" '
-       @echo -n 'CC="$(strip $(CC))" '
-       @echo -n 'OPT_CFLAGS="$(strip $(OPT_CFLAGS))" '
-       @echo -n 'ARCH_FLAGS="$(strip $(ARCH_FLAGS))" '
-       @echo -n 'CPU_CFLAGS="$(strip $(CPU_CFLAGS))" '
-       @echo -n 'STD_CFLAGS="$(strip $(STD_CFLAGS))" '
-       @echo -n 'WARN_CFLAGS="$(strip $(WARN_CFLAGS))" '
-       @echo -n 'NOWARN_CFLAGS="$(strip $(NOWARN_CFLAGS))" '
-       @echo -n 'ERROR_CFLAGS="$(strip $(ERROR_CFLAGS))" '
-       @echo -n 'CFLAGS="$(strip $(CFLAGS))" '
-       @#echo "$(strip $(BUILD_OPTIONS))"
+       @echo 'Using the following variables (copy-pastable as make arguments):'
+       @echo '  TARGET="$(strip $(TARGET))" '\\
+       @echo '  ARCH="$(strip $(ARCH))" '\\
+       @echo '  CC="$(strip $(CC))" '\\
+       @echo '  OPT_CFLAGS="$(strip $(OPT_CFLAGS))" '\\
+       @echo '  ARCH_FLAGS="$(strip $(ARCH_FLAGS))" '\\
+       @echo '  CPU_CFLAGS="$(strip $(CPU_CFLAGS))" '\\
+       @echo '  STD_CFLAGS="$(strip $(STD_CFLAGS))" '\\
+       @echo '  WARN_CFLAGS="$(strip $(WARN_CFLAGS))" '\\
+       @echo '  NOWARN_CFLAGS="$(strip $(NOWARN_CFLAGS))" '\\
+       @echo '  ERROR_CFLAGS="$(strip $(ERROR_CFLAGS))" '\\
+       @echo '  CFLAGS="$(strip $(CFLAGS))" '\\
        @$(foreach opt,$(enabled_opts),\
                $(if $(subst command line,,$(origin USE_$(opt))),,\
-                       echo -n 'USE_$(opt)=$(USE_$(opt:0=)) ';) \
+                       echo '  USE_$(opt)=$(USE_$(opt:0=)) '\\;) \
                $(if $(subst command line,,$(origin $(opt)_CFLAGS)),\
-                       $(if $($(opt)_CFLAGS),echo -n '$(opt)_CFLAGS="$($(opt)_CFLAGS)" ';),\
-                       echo -n '$(opt)_CFLAGS="$($(opt)_CFLAGS)" ';) \
+                       $(if $($(opt)_CFLAGS),echo '  $(opt)_CFLAGS="$($(opt)_CFLAGS)" '\\;),\
+                       echo '  $(opt)_CFLAGS="$($(opt)_CFLAGS)" '\\;) \
                $(if $(subst command line,,$(origin $(opt)_LDFLAGS)),\
-                       $(if $($(opt)_LDFLAGS),echo -n '$(opt)_LDFLAGS="$($(opt)_LDFLAGS)" ';),\
-                       echo -n '$(opt)_LDFLAGS="$($(opt)_LDFLAGS)" ';))
+                       $(if $($(opt)_LDFLAGS),echo '  $(opt)_LDFLAGS="$($(opt)_LDFLAGS)" '\\;),\
+                       echo '  $(opt)_LDFLAGS="$($(opt)_LDFLAGS)" '\\;))
+       @echo '  LDFLAGS="$(strip $(LDFLAGS))"'
        @echo
        @echo 'COPTS="$(strip $(COPTS))"'
-       @echo 'LDFLAGS="$(strip $(LDFLAGS))"'
        @echo 'LDOPTS="$(strip $(LDOPTS))"'
        @echo 'OPTIONS_OBJS="$(strip $(OPTIONS_OBJS))"'
        @echo 'OBJS="$(strip $(OBJS))"'