Note: There are a few cases of duplicates in user autocompletion which are being worked on.

makefile: add utility functions for identifying argument calling context for user functions

RESOLVED FIXED

Status

()

Core
Build Config
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: joey, Assigned: joey)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Define utility functions for make use that can identify the argument calling context for user defined functions.  Scalar and list at a miniumum.

istype()
isval()
isvar()

Use these to define a another function getvals() able to expand calling arguments so functions can be called as either:
   $(call func,var_of_values)
   $(call func,val1 val2 val3)

Also add a check unit test to validate behavior.

Logic can eventually be used by bug 680246 -- mkdir_deps -- to simplify usage.
(Assignee)

Updated

5 years ago
Assignee: nobody → joey
See Also: → bug 680246
(Assignee)

Comment 1

5 years ago
Created attachment 605375 [details] [diff] [review]
helper macros for writing make user functions

makeutils.mk - a makefile of helper macros for writing user functions { to be used by 680246 }.  Unit test included to lock down functionality.

allmakefiles.sh - a few /test(s)?/ entries were outside the ENABLE_TESTS block so moved them inside.
Attachment #605375 - Flags: review?(khuey)
(Assignee)

Updated

5 years ago
Blocks: 735638
(Assignee)

Comment 2

5 years ago
code review ping
Comment on attachment 605375 [details] [diff] [review]
helper macros for writing make user functions

Review of attachment 605375 [details] [diff] [review]:
-----------------------------------------------------------------

::: config/makefiles/test/manual.sh
@@ +4,5 @@
> +## obj unless configure is run so force it.
> +
> +# cd $obj/config/makefiles/test
> +make -C ../../../.. -f client.mk configure
> +make check

Er, what is this for?
Attachment #605375 - Flags: review?(khuey) → review-
(Assignee)

Comment 4

5 years ago
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #3)
> Comment on attachment 605375 [details] [diff] [review]
> helper macros for writing make user functions
> 
> Review of attachment 605375 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: config/makefiles/test/manual.sh
> @@ +4,5 @@
> > +## obj unless configure is run so force it.
> > +
> > +# cd $obj/config/makefiles/test
> > +make -C ../../../.. -f client.mk configure
> > +make check
> 
> Er, what is this for?

Just a helper script to force Makefile to regenerate while testing the check target.  Deps for Makefile: Makefile.in are not always forcing the target to regenerate, at least while pwd=${obj}/.... and a named target is in use.
(Assignee)

Comment 5

5 years ago
Created attachment 607555 [details] [diff] [review]
helper macros for writing make user functions

Same patch as last time but with the helper script removed.  Can manually copy in the script to force makefile regeneration when testing is required.
Attachment #605375 - Attachment is obsolete: true
Attachment #607555 - Flags: review?(khuey)
Attachment #607555 - Attachment is patch: true
Comment on attachment 607555 [details] [diff] [review]
helper macros for writing make user functions

Review of attachment 607555 [details] [diff] [review]:
-----------------------------------------------------------------

Ok, as long as that forced reconfigure isn't actually happening, this looks fine.
Attachment #607555 - Flags: review?(khuey) → review+
(Assignee)

Comment 7

5 years ago
these makefile edits should simmer in b-s for a while.
(Assignee)

Updated

5 years ago
Blocks: 734139
(Assignee)

Updated

5 years ago
Blocks: 738404
(Assignee)

Updated

5 years ago
Blocks: 739710

Comment 8

5 years ago
Comment on attachment 607555 [details] [diff] [review]
helper macros for writing make user functions

https://hg.mozilla.org/projects/build-system/rev/6236ee493160

A little bit of skew in allmakefiles.sh, but I cleaned that up.
(Assignee)

Comment 9

5 years ago
Patch landed on mozilla-central yesterday by Coop & Philor:
https://hg.mozilla.org/mozilla-central/rev/c598b7b202e7
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
(Assignee)

Updated

5 years ago
Blocks: 743280
(Assignee)

Updated

5 years ago
Blocks: 746151
(Assignee)

Updated

5 years ago
Blocks: 750303
You need to log in before you can comment on or make changes to this bug.