Last Comment Bug 734121 - makefile: add utility functions for identifying argument calling context for user functions
: makefile: add utility functions for identifying argument calling context for ...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Joey Armstrong [:joey]
:
: Gregory Szorc [:gps]
Mentors:
Depends on:
Blocks: 734139 735638 738404 739710 743280 746151 750303
  Show dependency treegraph
 
Reported: 2012-03-08 08:10 PST by Joey Armstrong [:joey]
Modified: 2012-04-30 08:58 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
helper macros for writing make user functions (10.63 KB, patch)
2012-03-13 06:42 PDT, Joey Armstrong [:joey]
khuey: review-
Details | Diff | Splinter Review
helper macros for writing make user functions (10.26 KB, patch)
2012-03-20 08:04 PDT, Joey Armstrong [:joey]
khuey: review+
Details | Diff | Splinter Review

Description Joey Armstrong [:joey] 2012-03-08 08:10:43 PST
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.
Comment 1 Joey Armstrong [:joey] 2012-03-13 06:42:45 PDT
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.
Comment 2 Joey Armstrong [:joey] 2012-03-15 12:20:43 PDT
code review ping
Comment 3 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-03-19 11:45:58 PDT
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?
Comment 4 Joey Armstrong [:joey] 2012-03-20 05:53:06 PDT
(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.
Comment 5 Joey Armstrong [:joey] 2012-03-20 08:04:34 PDT
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.
Comment 6 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-03-20 09:19:15 PDT
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.
Comment 7 Joey Armstrong [:joey] 2012-03-22 08:00:26 PDT
these makefile edits should simmer in b-s for a while.
Comment 8 Chris Cooper [:coop] 2012-04-03 10:39:48 PDT
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.
Comment 9 Joey Armstrong [:joey] 2012-04-05 10:03:43 PDT
Patch landed on mozilla-central yesterday by Coop & Philor:
https://hg.mozilla.org/mozilla-central/rev/c598b7b202e7

Note You need to log in before you can comment on or make changes to this bug.