| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 # Makefile debugging hack: uncomment the two lines below and make will tell you | 1 # Makefile debugging hack: uncomment the two lines below and make will tell you |
| 2 # more about what is happening. The output generated is of the form | 2 # more about what is happening. The output generated is of the form |
| 3 # "FILE:LINE [TARGET (DEPENDENCIES) (NEWER)]" where DEPENDENCIES are all the | 3 # "FILE:LINE [TARGET (DEPENDENCIES) (NEWER)]" where DEPENDENCIES are all the |
| 4 # things TARGET depends on and NEWER are all the files that are newer than | 4 # things TARGET depends on and NEWER are all the files that are newer than |
| 5 # TARGET. DEPENDENCIES will be colored green and NEWER will be blue. | 5 # TARGET. DEPENDENCIES will be colored green and NEWER will be blue. |
| 6 # | 6 # |
| 7 #OLD_SHELL := $(SHELL) | 7 #OLD_SHELL := $(SHELL) |
| 8 #SHELL = $(warning [$@ [32m($^) [34m($?)[m ])$(OLD_SHELL) | 8 #SHELL = $(warning [$@ [32m($^) [34m($?)[m ])$(OLD_SHELL) |
| 9 | 9 |
| 10 JSFILES=$(shell bzr ls -RV -k file | \ | 10 # Build a target for JavaScript files. The find command exclused directories |
| 11 » grep -E -e '.+\.js(on)?$$|generateTemplates$$' | \ | 11 # as needed through the -prune directive, and the grep command removes |
| 12 » grep -Ev -e '^manifest\.json$$' \ | 12 # individual unwanted JavaScript and JSON files from the list. |
| 13 » » -e '^test/assets/' \ | 13 JSFILES=$(shell find . -wholename './node_modules*' -prune \ |
|
gary.poster
2012/12/12 22:20:07
Before this, I think we need a comment explaining
benjamin.saller
2012/12/13 04:02:59
Looking at how this is used (and I realize its pre
matthew.scott
2012/12/13 17:34:04
I agree that it would be nice to have this be more
matthew.scott
2012/12/13 17:34:04
Done.
| |
| 14 » -o -wholename './build*' -prune \ | |
| 15 » -o -wholename './test/assets*' -prune \ | |
| 16 » -o \( \ | |
| 17 » » -name '*.js' \ | |
| 18 » » -o -name '*.json' \ | |
| 19 » » -o -name '*generateTemplates' \ | |
|
gary.poster
2012/12/12 22:20:07
This could simply be 'generateTemplates', without
matthew.scott
2012/12/13 17:34:04
Done.
| |
| 20 » \) -print \ | |
| 21 » | sort | sed -e 's/^\.\///' \ | |
| 22 » | grep -Ev -e '^manifest\.json$$' \ | |
| 23 » » -e '^app/assets/javascripts/d3.v2.*.js$$' \ | |
| 14 -e '^app/assets/javascripts/reconnecting-websocket.js$$' \ | 24 -e '^app/assets/javascripts/reconnecting-websocket.js$$' \ |
| 15 -e '^server.js$$') | 25 -e '^server.js$$') |
| 16 THIRD_PARTY_JS=app/assets/javascripts/reconnecting-websocket.js | 26 THIRD_PARTY_JS=app/assets/javascripts/reconnecting-websocket.js |
| 17 NODE_TARGETS=node_modules/chai node_modules/cryptojs node_modules/d3 \ | 27 NODE_TARGETS=node_modules/chai node_modules/cryptojs node_modules/d3 \ |
| 18 node_modules/expect.js node_modules/express node_modules/graceful-fs \ | 28 node_modules/expect.js node_modules/express node_modules/graceful-fs \ |
| 19 node_modules/grunt node_modules/jshint node_modules/less \ | 29 node_modules/grunt node_modules/jshint node_modules/less \ |
| 20 node_modules/minimatch node_modules/mocha node_modules/node-markdown \ | 30 node_modules/minimatch node_modules/mocha node_modules/node-markdown \ |
| 21 node_modules/node-minify node_modules/node-spritesheet \ | 31 node_modules/node-minify node_modules/node-spritesheet \ |
| 22 node_modules/rimraf node_modules/should node_modules/yui \ | 32 node_modules/rimraf node_modules/should node_modules/yui \ |
| 23 node_modules/yuidocjs | 33 node_modules/yuidocjs |
| 24 EXPECTED_NODE_TARGETS=$(shell echo "$(NODE_TARGETS)" | tr ' ' '\n' | sort \ | 34 EXPECTED_NODE_TARGETS=$(shell echo "$(NODE_TARGETS)" | tr ' ' '\n' | sort \ |
| 25 | tr '\n' ' ') | 35 | tr '\n' ' ') |
| 26 | 36 |
| 27 ### Release-specific variables - see docs/process.rst for an overview. ### | 37 ### Release-specific variables - see docs/process.rst for an overview. ### |
| 38 # Provide the ability to build a release package without using bzr, for | |
| 39 # lightweight checkouts. | |
| 40 ifdef NO_BZR | |
|
gary.poster
2012/12/12 22:20:07
Good solution, given our use cases and the other p
| |
| 41 BZR_REVNO=0 | |
| 42 BRANCH_IS_GOOD=1 | |
| 43 else | |
| 28 BZR_REVNO=$(shell bzr revno) | 44 BZR_REVNO=$(shell bzr revno) |
| 45 endif | |
| 29 # Figure out the two most recent version numbers. | 46 # Figure out the two most recent version numbers. |
| 30 ULTIMATE_VERSION=$(shell grep '^-' CHANGES.yaml | head -n 1 | sed 's/[ :-]//g') | 47 ULTIMATE_VERSION=$(shell grep '^-' CHANGES.yaml | head -n 1 | sed 's/[ :-]//g') |
| 31 PENULTIMATE_VERSION=$(shell grep '^-' CHANGES.yaml | head -n 2 | tail -n 1 \ | 48 PENULTIMATE_VERSION=$(shell grep '^-' CHANGES.yaml | head -n 2 | tail -n 1 \ |
| 32 | sed 's/[ :-]//g') | 49 | sed 's/[ :-]//g') |
| 33 # If the user specified (via setting an environment variable on the command | 50 # If the user specified (via setting an environment variable on the command |
| 34 # line) that this is a final (non-development) release, set the version number | 51 # line) that this is a final (non-development) release, set the version number |
| 35 # and series appropriately. | 52 # and series appropriately. |
| 36 ifdef FINAL | 53 ifdef FINAL |
| 37 # If this is a FINAL (non-development) release, then the most recent version | 54 # If this is a FINAL (non-development) release, then the most recent version |
| 38 # number should not be "unreleased". | 55 # number should not be "unreleased". |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 54 endif | 71 endif |
| 55 # If we are doing a production release (as opposed to a trial-run release) we | 72 # If we are doing a production release (as opposed to a trial-run release) we |
| 56 # use the "real" Launchpad site, if not we use the Launchpad staging site. | 73 # use the "real" Launchpad site, if not we use the Launchpad staging site. |
| 57 ifndef PROD | 74 ifndef PROD |
| 58 LAUNCHPAD_API_ROOT=staging | 75 LAUNCHPAD_API_ROOT=staging |
| 59 endif | 76 endif |
| 60 RELEASE_NAME=juju-gui-$(RELEASE_VERSION) | 77 RELEASE_NAME=juju-gui-$(RELEASE_VERSION) |
| 61 RELEASE_FILE=releases/$(RELEASE_NAME).tgz | 78 RELEASE_FILE=releases/$(RELEASE_NAME).tgz |
| 62 RELEASE_SIGNATURE=releases/$(RELEASE_NAME).asc | 79 RELEASE_SIGNATURE=releases/$(RELEASE_NAME).asc |
| 63 # Is the branch being released a branch of trunk? | 80 # Is the branch being released a branch of trunk? |
| 81 ifndef BRANCH_IS_GOOD | |
| 64 ifndef IS_TRUNK_BRANCH | 82 ifndef IS_TRUNK_BRANCH |
| 65 IS_TRUNK_BRANCH=$(shell bzr info | grep \ | 83 IS_TRUNK_BRANCH=$(shell bzr info | grep \ |
| 66 'parent branch: bzr+ssh://bazaar.launchpad.net/+branch/juju-gui/' \ | 84 'parent branch: bzr+ssh://bazaar.launchpad.net/+branch/juju-gui/' \ |
| 67 > /dev/null && echo 1) | 85 > /dev/null && echo 1) |
| 68 endif | 86 endif |
| 69 # Does the branch on disk have uncomitted/unpushed changes? | 87 # Does the branch on disk have uncomitted/unpushed changes? |
| 70 ifndef BRANCH_IS_CLEAN | 88 ifndef BRANCH_IS_CLEAN |
| 71 BRANCH_IS_CLEAN=$(shell [ -z "`bzr status`" ] && bzr missing --this && echo 1) | 89 BRANCH_IS_CLEAN=$(shell [ -z "`bzr status`" ] && bzr missing --this && echo 1) |
| 72 endif | 90 endif |
| 73 # Is it safe to do a release of the branch? For trial-run releases you can | 91 # Is it safe to do a release of the branch? For trial-run releases you can |
| 74 # override this check on the command line by setting the BRANCH_IS_GOOD | 92 # override this check on the command line by setting the BRANCH_IS_GOOD |
| 75 # environment variable. | 93 # environment variable. |
| 76 ifndef BRANCH_IS_GOOD | |
| 77 ifneq ($(strip $(IS_TRUNK_BRANCH)),) | 94 ifneq ($(strip $(IS_TRUNK_BRANCH)),) |
| 78 ifneq ($(strip $(BRANCH_IS_CLEAN)),) | 95 ifneq ($(strip $(BRANCH_IS_CLEAN)),) |
| 79 BRANCH_IS_GOOD=1 | 96 BRANCH_IS_GOOD=1 |
| 80 endif | 97 endif |
| 81 endif | 98 endif |
| 82 endif | 99 endif |
| 83 ### End of release-specific variables ### | 100 ### End of release-specific variables ### |
| 84 | 101 |
| 85 TEMPLATE_TARGETS=$(shell bzr ls -k file app/templates) | 102 TEMPLATE_TARGETS=$(shell find app/templates -type f -print) |
|
gary.poster
2012/12/12 22:20:07
Please exclude standard editor effluvia.
benjamin.saller
2012/12/13 04:02:59
This and the var below it are clear wins.
matthew.scott
2012/12/13 17:34:04
Done.
| |
| 86 | 103 |
| 87 SPRITE_SOURCE_FILES=$(shell bzr ls -R -k file app/assets/images) | 104 SPRITE_SOURCE_FILES=$(shell find app/assets/images -type f -print) |
|
gary.poster
2012/12/12 22:20:07
Please exclude standard editor effluvia.
matthew.scott
2012/12/13 17:34:04
Done.
| |
| 88 SPRITE_GENERATED_FILES=build/juju-ui/assets/sprite.css \ | 105 SPRITE_GENERATED_FILES=build/juju-ui/assets/sprite.css \ |
| 89 build/juju-ui/assets/sprite.png | 106 build/juju-ui/assets/sprite.png |
| 90 BUILD_FILES=build/juju-ui/assets/app.js \ | 107 BUILD_FILES=build/juju-ui/assets/app.js \ |
| 91 build/juju-ui/assets/all-yui.js \ | 108 build/juju-ui/assets/all-yui.js \ |
| 92 build/juju-ui/assets/combined-css/all-static.css | 109 build/juju-ui/assets/combined-css/all-static.css |
| 93 DATE=$(shell date -u) | 110 DATE=$(shell date -u) |
| 94 APPCACHE=build/juju-ui/assets/manifest.appcache | 111 APPCACHE=build/juju-ui/assets/manifest.appcache |
| 95 | 112 |
| 96 # Some environments, notably sudo, do not populate the PWD environment | 113 # Some environments, notably sudo, do not populate the PWD environment |
| 97 # variable, which is used to set $(PWD); however, getting the current | 114 # variable, which is used to set $(PWD); however, getting the current |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 @echo "release." | 383 @echo "release." |
| 367 @echo | 384 @echo |
| 368 @echo "See the README for more information." | 385 @echo "See the README for more information." |
| 369 @echo | 386 @echo |
| 370 @false | 387 @false |
| 371 endif | 388 endif |
| 372 | 389 |
| 373 $(RELEASE_SIGNATURE): $(RELEASE_FILE) | 390 $(RELEASE_SIGNATURE): $(RELEASE_FILE) |
| 374 gpg --armor --sign --detach-sig $(RELEASE_FILE) | 391 gpg --armor --sign --detach-sig $(RELEASE_FILE) |
| 375 | 392 |
| 376 dist: $(RELEASE_FILE) $(RELEASE_SIGNATURE) upload_release.py | 393 dist: $(RELEASE_FILE) $(RELEASE_SIGNATURE) upload_release.py |
|
gary.poster
2012/12/12 22:20:07
I would like the Makefile to refuse to run the upl
| |
| 377 python2 upload_release.py juju-gui $(SERIES) $(RELEASE_VERSION) \ | 394 python2 upload_release.py juju-gui $(SERIES) $(RELEASE_VERSION) \ |
| 378 $(RELEASE_FILE) $(LAUNCHPAD_API_ROOT) | 395 $(RELEASE_FILE) $(LAUNCHPAD_API_ROOT) |
| 379 | 396 |
| 380 appcache: $(APPCACHE) | 397 appcache: $(APPCACHE) |
| 381 | 398 |
| 382 # A target used only for forcibly updating the appcache. | 399 # A target used only for forcibly updating the appcache. |
| 383 appcache-touch: | 400 appcache-touch: |
| 384 touch manifest.appcache.in | 401 touch manifest.appcache.in |
| 385 | 402 |
| 386 # This is the real target. appcache-touch needs to be executed before | 403 # This is the real target. appcache-touch needs to be executed before |
| 387 # appcache, and this provides the correct order. | 404 # appcache, and this provides the correct order. |
| 388 appcache-force: appcache-touch appcache | 405 appcache-force: appcache-touch appcache |
| 389 | 406 |
| 390 # targets are alphabetically sorted, they like it that way :-) | 407 # targets are alphabetically sorted, they like it that way :-) |
| 391 .PHONY: appcache appcache-force appcache-touch beautify build \ | 408 .PHONY: appcache appcache-force appcache-touch beautify build \ |
| 392 build-debug build-files build-prod clean clean clean-all \ | 409 build-debug build-files build-prod clean clean clean-all \ |
| 393 clean-deps clean-docs debug devel doc dist gjslint help \ | 410 clean-deps clean-docs debug devel doc dist gjslint help \ |
| 394 javascript-libraries jshint link-debug-files link-prod-files \ | 411 javascript-libraries jshint link-debug-files link-prod-files \ |
| 395 lint prep prod server spritegen test test-debug test-prod \ | 412 lint prep prod server spritegen test test-debug test-prod \ |
| 396 undocumented yuidoc yuidoc-lint | 413 undocumented yuidoc yuidoc-lint |
| 397 | 414 |
| 398 .DEFAULT_GOAL := all | 415 .DEFAULT_GOAL := all |
| OLD | NEW |