bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #54116] Extend documentation for space-free line continuation techn


From: Michael Henry
Subject: [bug #54116] Extend documentation for space-free line continuation techniques
Date: Thu, 14 Jun 2018 12:44:08 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

URL:
  <http://savannah.gnu.org/bugs/?54116>

                 Summary: Extend documentation for space-free line
continuation techniques
                 Project: make
            Submitted by: drmikehenry
            Submitted on: Thu 14 Jun 2018 04:44:07 PM UTC
                Severity: 3 - Normal
              Item Group: Documentation
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: None
        Operating System: None
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

Line continuations via backslash/newline result in the insertion
of a single space character that often causes problems.  I've
discovered a method for suppressing that space which has low
syntactic overhead and is compatible with GNU Make versions as
far back as I can conveniently find.  I'd like to propose some
additions to GNU Make's documentation that demonstrate the
technique.  I've placed my suggestions on Github here:
https://github.com/drmikehenry/make
I've also attached a diff to this ticket.

There are two techniques documented in the repository above.
First, instead of using backslash/newline for line
continuations, use dollar sign/backslash/newline.  After each
backslash-newline has been replaced with a single space, this
leaves dollar sign/space pairs which syntactically expand the
single-character variable named <space>; as that variable is not
defined by default, these pairs evaporate to the empty string.
As a simple example, this:


  x := one$\
       word


is equivalent to this:


  x := oneword


In addition, I've documented a second technique for handling
line continuations.  It involves post-processing a multiline
variable to remove newlines and indentation as a way of avoiding
the problems of the injected space character.  This method
requires GNU Make 3.80 or later because it uses $(eval) and
$(value), but it results in very readable user-defined
functions.

I've also included a small unit test to help ensure that no
future version of GNU Make will throw warnings or errors when
evaluating the single-character variable named <space>.

My main hope is to ensure that GNU Make does not change in the
future in a way that would break the dollar
sign/backslash/newline technique.  Thanks for your
consideration.

Michael Henry




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 14 Jun 2018 04:44:07 PM UTC  Name: make.diff  Size: 5KiB   By:
drmikehenry

<http://savannah.gnu.org/bugs/download.php?file_id=44369>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54116>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]