Closed Bug 734121 Opened 8 years ago Closed 8 years ago

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

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: joey, Assigned: joey)

References

Details

Attachments

(1 file, 1 obsolete file)

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: nobody → joey
See Also: → 680246
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)
Blocks: 735638
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-
(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.
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)
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+
these makefile edits should simmer in b-s for a while.
Blocks: 734139
Blocks: 738404
Blocks: 739710
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.
Patch landed on mozilla-central yesterday by Coop & Philor:
https://hg.mozilla.org/mozilla-central/rev/c598b7b202e7
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Blocks: 743280
Blocks: 746151
Blocks: 750303
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.