[riot-commits] [RIOT-OS/RIOT] 3ed963: makefiles/color: preprocess color strings.

Leandro Lanzieri noreply at github.com
Tue May 4 18:30:18 CEST 2021


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 3ed96312afc3fcb1cfa8f287eed9d822cb131710
      https://github.com/RIOT-OS/RIOT/commit/3ed96312afc3fcb1cfa8f287eed9d822cb131710
  Author: Juan Carrano <j.carrano at fu-berlin.de>
  Date:   2021-05-04 (Tue, 04 May 2021)

  Changed paths:
    M makefiles/color.inc.mk

  Log Message:
  -----------
  makefiles/color: preprocess color strings.

The color strings COLOR_* are redefined so that they don't have to be
processed by "echo -e". This is done by storing the already interpreted
ANSI sequence in a shell variable.

With this change, not only can color messages be printed using normal
`echo` with no switches: colors also work with the `info` and `warning`
builtins of make.

The COLOR_ECHO variable is kept because it is also being used (confusingly)
to intepret tabs an newlines. This will be fixed in another commit.

This change should change absolutely anything and colors should still work
as always.


  Commit: 1036115f2d497a111d737509d490163e1d49a4a8
      https://github.com/RIOT-OS/RIOT/commit/1036115f2d497a111d737509d490163e1d49a4a8
  Author: Juan Carrano <j.carrano at fu-berlin.de>
  Date:   2021-05-04 (Tue, 04 May 2021)

  Changed paths:
    M Makefile.include
    M makefiles/color.inc.mk
    A makefiles/utils/ansi.mk
    A makefiles/utils/ansi_special.mk

  Log Message:
  -----------
  makefiles/utils/ansi: Refactor ansi codes into their own file.

The escape codes and special chars now live in their own module. The
color module is only concerned with detecting whether to use colors or
not.

Additional variables are defined with hard a coded ESC char, a tab and a
newline. This removes the need for echo or printf.


  Commit: 9fe8f54db99ed9c9b6f548576250f44429d727f0
      https://github.com/RIOT-OS/RIOT/commit/9fe8f54db99ed9c9b6f548576250f44429d727f0
  Author: Juan Carrano <j.carrano at fu-berlin.de>
  Date:   2021-05-04 (Tue, 04 May 2021)

  Changed paths:
    M makefiles/color.inc.mk

  Log Message:
  -----------
   makefiles/color: Add color functions.

c_xxxx functions can be used to wrap a piece of text in a
$(COLOR_X)...$(COLOR_RESET) block, thereby avoiding the easy mistake
of forgetting to place a COLOR_RESET.


  Commit: 8107b8f3f20efc0487dc06065460d9f1cf7556ac
      https://github.com/RIOT-OS/RIOT/commit/8107b8f3f20efc0487dc06065460d9f1cf7556ac
  Author: Leandro Lanzieri <leandro.lanzieri at haw-hamburg.de>
  Date:   2021-05-04 (Tue, 04 May 2021)

  Changed paths:
    M Makefile.include
    M makefiles/color.inc.mk
    A makefiles/utils/ansi.mk
    A makefiles/utils/ansi_special.mk

  Log Message:
  -----------
  Merge pull request #16434 from fjmolinas/pr_color_functions

TAKEOVER: makefiles/color: Add color functions, new attempt. #12156


Compare: https://github.com/RIOT-OS/RIOT/compare/4c38f6972908...8107b8f3f20e


More information about the commits mailing list