Merge lp:~abentley/launchpad/makefile-tweak into lp:launchpad

Proposed by Aaron Bentley on 2012-08-29
Status: Merged
Approved by: Aaron Bentley on 2012-08-29
Approved revision: no longer in the source branch.
Merged at revision: 15878
Proposed branch: lp:~abentley/launchpad/makefile-tweak
Merge into: lp:launchpad
Diff against target: 26 lines (+6/-3)
1 file modified
Makefile (+6/-3)
To merge this branch: bzr merge lp:~abentley/launchpad/makefile-tweak
Reviewer Review Type Date Requested Status
Richard Harding (community) 2012-08-29 Approve on 2012-08-29
Review via email: mp+121885@code.launchpad.net

Commit Message

Tweak Makefile rules for JS.

Description of the Change

= Summary =
Tweak makefile rules to run fewer cp commands.

== Proposed fix ==
Use a pattern rule, instead of an overkill rule, to copy files from lib/canonical/launchpad/icing/yui_2.7.0b/build/ to build/js/yui2/

== Pre-implementation notes ==
Discussed with rick_h

== LOC Rationale ==
Part of private projects.

== Implementation details ==
The existing rule to copy the YUI 2.7 files would copy all YUI 2.7 files for each file in JS_YUI (which included many non 2.7 files).

The new rule is triggered only on YUI 2.7 files, and only copies one file at a time. (Consequently, it has to ensure the directory exists, first.)

As a driveby, I cleaned up a long line at 206.

== Tests ==
None

== Demo and Q/A ==
None

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  Makefile

To post a comment you must log in.
Richard Harding (rharding) wrote :

Thanks for fixing up my usage Aaron!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2012-08-13 18:27:18 +0000
3+++ Makefile 2012-08-29 15:25:27 +0000
4@@ -187,8 +187,10 @@
5 done
6
7 $(JS_LP): jsbuild_widget_css
8-$(JS_YUI):
9- cp -a lib/canonical/launchpad/icing/yui_2.7.0b/build build/js/yui2
10+
11+build/js/yui2/%: lib/canonical/launchpad/icing/yui_2.7.0b/build/%
12+ mkdir -p `dirname $@`
13+ cp -a $< $@
14
15 # YUI_DEFAULT is one of the targets in YUI_BUILDS which expands all of our YUI
16 # versions for us.
17@@ -201,7 +203,8 @@
18 endif
19
20 combobuild:
21- utilities/js-deps -n LP_MODULES -s build/js/lp -x '-min.js' -o build/js/lp/meta.js >/dev/null
22+ utilities/js-deps -n LP_MODULES -s build/js/lp -x '-min.js' -o \
23+ build/js/lp/meta.js >/dev/null
24 utilities/check-js-deps
25
26 jsbuild: $(PY) $(JS_OUT)