bugmake - Bugs: bug #51306, Checking programming possibilities...

 
 

bug #51306: Checking programming possibilities around “MAKECMDGOALS”

Submitter:  Markus Elfring <elfring>
Submitted:  Sat 24 Jun 2017 08:22:36 PM UTC
   
 
Severity:  3 - Normal Item Group:  Documentation
Status:  Fixed Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  4.2.1 Operating System:  Any
Fixed Release:  4.4 Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 02 Jul 2017 07:08:55 PM UTC, comment #4: 

But the make rule set can be adjusted in some ways according to the query result.

Markus Elfring <elfring>
Sun 02 Jul 2017 07:03:56 PM UTC, comment #3: 

You can't change the set of goals that make will build by modifying the MAKECMDGOALS variable.  All you can do is query which goals it will build.

Paul D. Smith <psmith>
Group administrator
Sun 02 Jul 2017 05:38:32 PM UTC, comment #2: 

I imagine that there is a need to express higher level requirements.

If you know for example that parameter like “distclean” was passed somewhere in the list of make goals, I guess that it can make sense to omit the execution of previous targets while subsequent targets could be updated again.

Markus Elfring <elfring>
Sun 02 Jul 2017 05:18:17 PM UTC, comment #1: 

The same way you'd check for a word in any other list of words, in GNU make:


sources = foo.c bar.c

ifeq (,$(filter clean,$(MAKECMDGOALS)))
include $(sources:.c=.d)
endif


will only include the files if "clean" doesn't appear anywhere in MAKECMDGOALS.

However, I'm not sure that this is the correct behavior.  Suppose someone used "make clean all"; now none of the dependency files will be included for the "all" target.

I'll leave this open as a Doc bug to determine whether the example needs to be reworked.

Paul D. Smith <psmith>
Group administrator
Sat 24 Jun 2017 08:22:36 PM UTC, original submission:  

The documentation contains the following information:
“…
Make will set the special variable MAKECMDGOALS to the list of goals you specified on the command line.
…”


I imagine that such a list can occasionally provide several elements. I would find the presented example insufficient in this case because only a simple string comparison is performed there.

  • How should the specified goals be really checked in a safe way?
  • Is another software extension needed for the make function library?
Markus Elfring <elfring>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by elfring (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-08-31 psmith StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.4
        Triage StatusNone Small Effort
    2017-07-02 psmith Item GroupBug Documentation

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code