Skip to content

Commit

Permalink
Makefile: Fix awk command in "make help"
Browse files Browse the repository at this point in the history
Typing "make help" currently prints a waring from awk (GNU Awk 5.1.0):

    $ make help

    Usage:
      make <target>

    Targets:
    awk: cmd. line:1: warning: regexp escape sequence `\_' is not a known regexp operator
      pwru                 Build the GO binary
      release              Build the GO binary within a Docker container
      local-release        Build a new release
      install              Install the GO Binary to the location specified by 'BINDIR'
      clean                Clean up build artifacts
      test                 Run GO tests
      help                 Show this hel

This is because the Makefile escapes the underscore ("\_"). As far as I
know, there is no reason to escape it, so we can just remove the
backslash. In the same list of characters, there's no reason to escape
the dash either, the man page for GNU Awk says: "To include a literal
dash in the list, put it first or last", so we can just do that.

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
  • Loading branch information
qmonnet authored and brb committed Dec 20, 2023
1 parent 0d23d55 commit 3307e5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ help:
@echo ''
@echo 'Targets:'

@awk '/^[a-zA-Z\-\_0-9]+:/ { \
@awk '/^[a-zA-Z0-9_-]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
Expand Down

0 comments on commit 3307e5c

Please sign in to comment.