bugmake - Bugs: bug #44442, plugin interface enhancements


bug #44442: plugin interface enhancements

Submitted by:  Brian Vandenberg <phantal>
Submitted on:  Fri 06 Mar 2015 02:41:08 AM UTC  
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.1 Operating System:  Any
Fixed Release:  None Triage Status:  None

Add a New Comment (Rich Markup)

You are not logged in

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


Fri 06 Mar 2015 06:22:23 PM UTC, 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))
IFBLAH = $(strip $(2))

... 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 06 Mar 2015 02:41:08 AM UTC, 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 Files:

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
  • -email is unavailable- added by phantal (Submitted the item)

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

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-06 phantal Attached File- => Added example.c, #33265

    Back to the top

    Powered by Savane 3.5