bugmake - Bugs: bug #44442, plugin interface enhancements

 
 

bug #44442: plugin interface enhancements

Submitted by:  Brian Vandenberg <phantal>
Submitted on:  Fri Mar 6 02:41:08 2015  
 
Severity: 3 - NormalItem Group: Enhancement
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 4.1Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri Mar 6 18:22:23 2015, comment #1:

re: the example I just uploaded ... my comment was poorly worded. I re-wrote it to look more like the functions in "function.c" in the make source -- though I wasn't sure what to use in place of gmk_expand.

Another useful one would be a variant of $(call ...); for lack of a better name I'll refer to it as $(call_noexpand, ...). As the name implies, the arguments are not automatically expanded.

I have macros written of the form:

ifeq 'undefined' '$(origin somevariable)'
IFBLAH = $(strip $(1))
else
IFBLAH = $(strip $(2))
endif

... where, in a makefile you'd use it as:

$(call IFBLAH, <true>, <false>)

I had attempted to use these macros to generate build warnings/errors like this:

$(call IFBLAH,,$(error Not ok to do this))

... but because func_call is marked to expand parameters before the call is made, this causes the $(error) to be generated always, not just on the false condition.

An alternate version of $(call ...) would be quite helpful for that purpose.

Brian Vandenberg <phantal>
Fri Mar 6 02:41:08 2015, original submission:

1) export more functions that allow access to some of the internal workings of make, eg:

  • make existing macro functions like func_strip, etc non-static and available in the public interface header(s). Obviously I could use gmk_eval or gmk_expand but I'd rather be able to call them directly.
  • functions like lookup_variable, or a watered down version of it. Adding a new macro like $(ifdef VARNAME, <true>, <false>) or anything similar currently requires either creating your own extern decl for it and hoping the interface doesn't change, or going through gmk_expand and using $(origin) or somesuch.

2) add a callback interface with various events we can add functions to; for example, if I wanted to add a callback for logging purposes.

Brian Vandenberg <phantal>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #33265:  example.c added by phantal (473B - application/octet-stream - Here's an example of how I implemented $(ifdef, though in this case I've modified it (untested) in the hopes you'd be willing to add this to the existing list of functions)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by phantal (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Mar 6 18:16:49 2015phantalAttached File-=>Added example.c, #33265

    Back to the top


    Powered by Savane 3.1-cleanup1