[bug #8297] Add a non-posix feature for parallel mode.

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Add a non-posix feature for parallel mode.

anonymous-27

Follow-up Comment #2, bug #8297 (project make):

Solaris "make" utility provides the following solution: if the
targets are connected (separated) with a "+" sign, they are
combined in a target group.

  target [+ target...] :  Target group. The rule in the target
                          entry  builds all the indicated tar-
                          gets as a group. It is normally per-
                          formed  only  once per make run, but
                          is checked for command  dependencies
                          every  time a target in the group is
                          encountered in the dependency scan.

Here is an example:

# Dependencies
cmdparser.hpp: cmdparser.cpp
cmdparser.cpp: cmdparser.y

# Common Rule
cmdparser.hpp + cmdparser.cpp:
        bison -d -o cmdparser.cpp cmdparser.y

I can be wrong, but I think POSIX standard allows this syntax.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8297>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Add a non-posix feature for parallel mode.

anonymous-27

Follow-up Comment #3, bug #8297 (project make):

Yes, but I don't like that syntax because it seems to allow both kinds of
"rules" to be defined at the same time; consider:

  foo + bar baz boz + biz:

What does this mean?  In discussions on the GNU make developers' list we
discussed a syntax like this:

    foo bar |: biz baz
    %.y %.z |: %.a

and:

    foo bar &: biz baz
    %.y %.z &: %.a

The "&:" separator means that all targets are built with one invocation
(default today for pattern rules) and the "|:" separator means each target is
built with a separate invocation (default today for explicit rules).  The
unadorned ":" would keep its current behavior (different depending on whether
you use pattern or explicit rules).

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8297>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Add a non-posix feature for parallel mode.

anonymous-27

Follow-up Comment #4, bug #8297 (project make):

I can answer this question wrt Solaris make and Sun Studio dmake.

foo + bar baz boz + biz:

What does this mean?

It means there are 2 groups:
1. foo + bar
2. boz + biz

Here is an example.
-------------------
volga2% cat Makefile
T = foo bar baz boz biz
all: ${T}
# Two groups
foo + bar baz boz + biz:
        @echo $@
        touch ${T}

If I run GNU make, it treats "+" as a target,
and repeats the same command 5 times:
-------------------------------------
volga2% rm -f foo bar baz boz biz
volga2% gmake -j 8
Makefile:7: target `+' given more than once in the same rule.
foo
touch foo bar baz boz biz
bar
baz
boz
biz
touch foo bar baz boz biz
touch foo bar baz boz biz
touch foo bar baz boz biz
touch foo bar baz boz biz

If I run Sun Studio dmake, it treats "+" as a group sign,
and repeats the same command 3 times:
-------------------------------------
volga2% rm -f foo bar baz boz biz
volga2% dmake -j 8
echo baz
baz
touch foo bar baz boz biz
echo boz
boz
touch foo bar baz boz biz
echo foo
foo
touch foo bar baz boz biz



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8297>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Add a non-posix feature for parallel mode.

Bogdan Barbu

Follow-up Comment #5, bug #8297 (project make):

At the very least, the documentation needs to be revised to discuss the
situation of multiple targets being produced by a rule action and to offer the
pattern workaround.

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Add a non-posix feature for parallel mode.

Bogdan Barbu

Follow-up Comment #6, bug #8297 (project make):

How about adding a new special target such as '.MULTIPLE_OUTPUTS'?  Usage
would be something like:

.MULTIPLE_OUTPUTS cmdparser.cpp cmdparser.h: cmdparser.y
    bison -d -o cmdparser.cpp cmdparser.y

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Allow multiple targets to be built from a single explicit rule recipe invocation

Bogdan Barbu
Update of bug #8297 (project make):

                 Summary: Add a non-posix feature for parallel mode. => Allow
multiple targets to be built from a single explicit rule recipe invocation

    _______________________________________________________

Follow-up Comment #7:

FYI some discussion of this feature can be found here:

https://lists.gnu.org/archive/html/make-alpha/2002-12/msg00000.html

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?8297>

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


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Allow multiple targets to be built from a single explicit rule recipe invocation

Bogdan Barbu
Additional Item Attachment, bug #8297 (project make):

File name: 0001-Implement-grouped-targets-in-ordinary-rules.patch Size:10 KB
   
<https://savannah.gnu.org/file/0001-Implement-grouped-targets-in-ordinary-rules.patch?file_id=46529>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?8297>

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


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Allow multiple targets to be built from a single explicit rule recipe invocation

Bogdan Barbu
Follow-up Comment #8, bug #8297 (project make):

The patch I uploaded just now is almost the same as what I posted to the
mailing list, modulo fixing a memory leak (not freeing the also_make dep list
built up in the register_files function).

Paul Smith pointed to this bug and suggested the &: syntax instead; I will be
reworking the change to use that syntax.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?8297>

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


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Allow multiple targets to be built from a single explicit rule recipe invocation

Bogdan Barbu
Additional Item Attachment, bug #8297 (project make):

File name: 0001-Implement-grouped-targets-in-ordinary-rules.patch Size:20 KB
   
<https://savannah.gnu.org/file/0001-Implement-grouped-targets-in-ordinary-rules.patch?file_id=46536>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?8297>

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


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Allow multiple targets to be built from a single explicit rule recipe invocation

Bogdan Barbu
Additional Item Attachment, bug #8297 (project make):

File name: 0001-Implement-grouped-targets-in-ordinary-rules.patch Size:20 KB
   
<https://savannah.gnu.org/file/0001-Implement-grouped-targets-in-ordinary-rules.patch?file_id=46537>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?8297>

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


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Allow multiple targets to be built from a single explicit rule recipe invocation

Bogdan Barbu
Follow-up Comment #9, bug #8297 (project make):

Regarding the past discussion, this comment by Henning Makholm:

https://lists.gnu.org/archive/html/make-alpha/2002-12/msg00007.html

provides an accurate synopsis of what I have also done.

From the GNU Make manual, I realized that the semantics is already present in
pattern rules. Then in the code I found the also_make member of struct file
and so it went.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?8297>

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


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Allow multiple targets to be built from a single explicit rule recipe invocation

Bogdan Barbu
Additional Item Attachment, bug #8297 (project make):

File name: 0001-Implement-grouped-targets-in-ordinary-rules.patch Size:23 KB
   
<https://savannah.gnu.org/file/0001-Implement-grouped-targets-in-ordinary-rules.patch?file_id=46542>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?8297>

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


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Allow multiple targets to be built from a single explicit rule recipe invocation

Bogdan Barbu
Update of bug #8297 (project make):

                  Status:                    None => Fixed                  
             Assigned to:                    None => psmith                
             Open/Closed:                    Open => Closed                
           Fixed Release:                    None => SCM                    

    _______________________________________________________

Follow-up Comment #10:

I made some changes to the patch and pushed it to Git master.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?8297>

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


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

[bug #8297] Allow multiple targets to be built from a single explicit rule recipe invocation

Bogdan Barbu
Follow-up Comment #11, bug #8297 (project make):

[comment #10 comment #10:]

How do you think about to insert a specification like “@cindex &:” in the
file “make.texi”
<https://git.savannah.gnu.org/cgit/make.git/tree/doc/make.texi?id=f430a65ccb5e85eb465f6a64afcbdd09f9c708ed#n3187>?

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?8297>

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