[bug #60811] Add long-form aliases for automatic variables

2023-03-11 Thread Gwyneth Morgan
Follow-up Comment #3, bug #60811 (project make):

Will this patch be considered? This would simplify writing understandable
Makefiles that work across implementations.

If long-form aliases like this are unwanted, adding $> as an alias to $^ would
work as well.

[comment #0 original submission:]
> BSD Make has several long-form aliases for automatic variables, such as
`${.TARGET}` for `$@`. These are helpful for readability.
> 
> GNU Make and BSD Make both have automatic variables for all prerequisites,
but they differ (`$^` in GNU, `$>` or `${.ALLSRC}` in BSD), which makes
writing portable makefiles tricky. Adding `${.ALLSRC}` as an alias for `$^`
makes portability easier.
> 
> Introduce these automatic variable aliases for easier readability and
portability:
> 
> 
> .IMPSRC = $<
> .PREFIX = $*
> .TARGET = $@
> .MEMBER = $%
> .ALLSRC = $^  # $> in BSD Make
> .OODATE = $?
> 
> 
> Pass --directory=src when applying patch with git.


___

Reply to this item at:

  

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




[bug #60811] Add long-form aliases for automatic variables

2021-06-25 Thread Gwyneth Morgan
Follow-up Comment #2, bug #60811 (project make):

BSD Make already has $<, $@, etc, which have corresponding long-form names
like .IMPSRC, .TARGET, etc. However, $> in BSD Make is $^ in GNU Make, which
makes it difficult to write makefiles usable in both BSD/GNU Make.

GNU Make's $^ is unportable already, so adding .ALLSRC would make it more
portable as then you could use this in both BSD/GNU Make.

If not long-form aliases, we could add $> to GNU Make as an alias to $^.
Adding new variables to BSD Make would be more difficult, because I believe
there isn't one single "BSD Make", but each BSD has its own, so I would need
to convince each BSD to add a new variable to their make rather than adding it
in one place. Each of these BSD Make variants support $>, so I think adding it
to gmake would improve the portability.

___

Reply to this item at:

  

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




[bug #60811] Add long-form aliases for automatic variables

2021-06-23 Thread Dmitry Goncharov
Follow-up Comment #1, bug #60811 (project make):

$<, $@, etc are the portable automatic variables. These are standardized by
posix and supported by other unix makes, e.g. sun and ibm makes.
On the other hand, .IMPSRC, etc are not portable.
Introduction of .IMPSRC to gmake cannot improve portability, it can only
hinder it.
Have you considered adding $<, etc to bsd make to improve portability?

In regards to readability, i like this

%.o: %.c
cc -o $@ -c $<

much better than this

%.o: %.c
cc -o $(.TARGET) -c $(.IMPSRC)


___

Reply to this item at:

  

___
  Сообщение отправлено по Savannah
  https://savannah.gnu.org/




[bug #60811] Add long-form aliases for automatic variables

2021-06-22 Thread Gwyneth Morgan
URL:
  

 Summary: Add long-form aliases for automatic variables
 Project: make
Submitted by: gwymor
Submitted on: Wed 23 Jun 2021 03:53:55 AM UTC
Severity: 3 - Normal
  Item Group: Enhancement
  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:

BSD Make has several long-form aliases for automatic variables, such as
`${.TARGET}` for `$@`. These are helpful for readability.

GNU Make and BSD Make both have automatic variables for all prerequisites, but
they differ (`$^` in GNU, `$>` or `${.ALLSRC}` in BSD), which makes writing
portable makefiles tricky. Adding `${.ALLSRC}` as an alias for `$^` makes
portability easier.

Introduce these automatic variable aliases for easier readability and
portability:


.IMPSRC = $<
.PREFIX = $*
.TARGET = $@
.MEMBER = $%
.ALLSRC = $^# $> in BSD Make
.OODATE = $?


Pass --directory=src when applying patch with git.



___

File Attachments:


---
Date: Wed 23 Jun 2021 03:53:55 AM UTC  Name: bmake-automatic-vars.patch  Size:
2KiB   By: gwymor



___

Reply to this item at:

  

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