Create directories for targets in Makefile.
This commit is contained in:
parent
0994fe6e79
commit
9226465b95
38
Makefile
38
Makefile
@ -4,12 +4,12 @@ ifeq "$(OS)" "Windows_NT"
|
|||||||
BIN := $(subst /,\,node_modules/.bin/)
|
BIN := $(subst /,\,node_modules/.bin/)
|
||||||
RMDIR := -rmdir /s /q
|
RMDIR := -rmdir /s /q
|
||||||
RM := -del
|
RM := -del
|
||||||
CP = mkdir $(subst /,\,$(dir $@)) & copy /y $(subst /,\,$<) $(subst /,\,$@)
|
CP = copy /y $(subst /,\,$<) $(subst /,\,$@)
|
||||||
else
|
else
|
||||||
BIN := node_modules/.bin/
|
BIN := node_modules/.bin/
|
||||||
RMDIR := rm -rf
|
RMDIR := rm -rf
|
||||||
RM := rm -rf
|
RM := rm -rf
|
||||||
CP = mkdir -p $(dir $@) && cp $< $@
|
CP = cp $< $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
coffee := $(BIN)coffee -c --no-header
|
coffee := $(BIN)coffee -c --no-header
|
||||||
@ -18,9 +18,9 @@ template := $(BIN)coffee tools/templates.coffee
|
|||||||
template_deps := \
|
template_deps := \
|
||||||
package.json version.json \
|
package.json version.json \
|
||||||
tools/templates.coffee \
|
tools/templates.coffee \
|
||||||
node_modules/coffee-script/package.json node_modules/fs-extra/package.json node_modules/lodash/package.json
|
node_modules/coffee-script/package.json node_modules/lodash/package.json
|
||||||
cat := node tools/cat.js
|
cat := node tools/cat.js
|
||||||
cat_deps := tools/cat.js node_modules/fs-extra/package.json
|
cat_deps := tools/cat.js
|
||||||
jshint_deps := .jshintrc node_modules/jshint/package.json
|
jshint_deps := .jshintrc node_modules/jshint/package.json
|
||||||
|
|
||||||
sources := \
|
sources := \
|
||||||
@ -109,7 +109,10 @@ node_modules/%/package.json : .events/npm
|
|||||||
.tests_enabled :
|
.tests_enabled :
|
||||||
echo false> .tests_enabled
|
echo false> .tests_enabled
|
||||||
|
|
||||||
tmp/script.coffee : $(sources) $(cat_deps)
|
tmp :
|
||||||
|
mkdir $@
|
||||||
|
|
||||||
|
tmp/script.coffee : $(sources) $(cat_deps) | tmp
|
||||||
$(cat) $(sources) $@
|
$(cat) $(sources) $@
|
||||||
|
|
||||||
tmp/script-%.coffee : tmp/script.coffee $(imports) $(template_deps)
|
tmp/script-%.coffee : tmp/script.coffee $(imports) $(template_deps)
|
||||||
@ -118,24 +121,30 @@ tmp/script-%.coffee : tmp/script.coffee $(imports) $(template_deps)
|
|||||||
tmp/script-%.js : tmp/script-%.coffee $(coffee_deps)
|
tmp/script-%.js : tmp/script-%.coffee $(coffee_deps)
|
||||||
$(coffee) $<
|
$(coffee) $<
|
||||||
|
|
||||||
tmp/eventPage.js : src/General/eventPage.coffee $(coffee_deps)
|
tmp/eventPage.js : src/General/eventPage.coffee $(coffee_deps) | tmp
|
||||||
$(coffee) -o tmp src/General/eventPage.coffee
|
$(coffee) -o tmp src/General/eventPage.coffee
|
||||||
|
|
||||||
|
testbuilds :
|
||||||
|
mkdir $@
|
||||||
|
|
||||||
define rules_channel
|
define rules_channel
|
||||||
|
|
||||||
testbuilds/crx$1/script.js : src/meta/botproc.js LICENSE src/meta/usestrict.js tmp/script-crx.js $(cat_deps)
|
testbuilds/crx$1 : | testbuilds
|
||||||
|
mkdir $$@
|
||||||
|
|
||||||
|
testbuilds/crx$1/script.js : src/meta/botproc.js LICENSE src/meta/usestrict.js tmp/script-crx.js $(cat_deps) | testbuilds/crx$1
|
||||||
$(cat) src/meta/botproc.js LICENSE src/meta/usestrict.js tmp/script-crx.js $$@
|
$(cat) src/meta/botproc.js LICENSE src/meta/usestrict.js tmp/script-crx.js $$@
|
||||||
|
|
||||||
testbuilds/crx$1/eventPage.js : tmp/eventPage.js
|
testbuilds/crx$1/eventPage.js : tmp/eventPage.js | testbuilds/crx$1
|
||||||
$$(CP)
|
$$(CP)
|
||||||
|
|
||||||
testbuilds/crx$1/icon%.png : src/meta/icon%.png
|
testbuilds/crx$1/icon%.png : src/meta/icon%.png | testbuilds/crx$1
|
||||||
$$(CP)
|
$$(CP)
|
||||||
|
|
||||||
testbuilds/crx$1/manifest.json : src/meta/manifest.json $(template_deps)
|
testbuilds/crx$1/manifest.json : src/meta/manifest.json $(template_deps) | testbuilds/crx$1
|
||||||
$(template) $$< $$@ type=crx channel=$1
|
$(template) $$< $$@ type=crx channel=$1
|
||||||
|
|
||||||
testbuilds/updates$1.xml : src/meta/updates.xml $(template_deps)
|
testbuilds/updates$1.xml : src/meta/updates.xml $(template_deps) | testbuilds/crx$1
|
||||||
$(template) $$< $$@ type=crx channel=$1
|
$(template) $$< $$@ type=crx channel=$1
|
||||||
|
|
||||||
testbuilds/$(name)$1.crx.zip : \
|
testbuilds/$(name)$1.crx.zip : \
|
||||||
@ -146,7 +155,7 @@ testbuilds/$(name)$1.crx.zip : \
|
|||||||
testbuilds/$(name)$1.crx : testbuilds/$(name)$1.crx.zip package.json tools/sign.js node_modules/crx/package.json
|
testbuilds/$(name)$1.crx : testbuilds/$(name)$1.crx.zip package.json tools/sign.js node_modules/crx/package.json
|
||||||
node tools/sign.js $1
|
node tools/sign.js $1
|
||||||
|
|
||||||
testbuilds/$(name)$1.meta.js : src/meta/metadata.js src/meta/icon48.png $(template_deps)
|
testbuilds/$(name)$1.meta.js : src/meta/metadata.js src/meta/icon48.png $(template_deps) | testbuilds
|
||||||
$(template) $$< $$@ type=userscript channel=$1
|
$(template) $$< $$@ type=userscript channel=$1
|
||||||
|
|
||||||
testbuilds/$(name)$1.user.js : src/meta/botproc.js testbuilds/$(name)$1.meta.js LICENSE src/meta/usestrict.js tmp/script-userscript.js $(cat_deps)
|
testbuilds/$(name)$1.user.js : src/meta/botproc.js testbuilds/$(name)$1.meta.js LICENSE src/meta/usestrict.js tmp/script-userscript.js $(cat_deps)
|
||||||
@ -161,7 +170,10 @@ $(eval $(call rules_channel,-noupdate))
|
|||||||
testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip
|
testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip
|
||||||
$(CP)
|
$(CP)
|
||||||
|
|
||||||
builds/% : testbuilds/% $(jshint)
|
builds :
|
||||||
|
mkdir $@
|
||||||
|
|
||||||
|
builds/% : testbuilds/% $(jshint) | builds
|
||||||
$(CP)
|
$(CP)
|
||||||
|
|
||||||
test.html : README.md template.jst tools/markdown.js node_modules/marked/package.json node_modules/lodash/package.json
|
test.html : README.md template.jst tools/markdown.js node_modules/marked/package.json node_modules/lodash/package.json
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
var fs = require('fs-extra');
|
var fs = require('fs');
|
||||||
|
|
||||||
var text = process.argv.slice(2, -1).map(x => fs.readFileSync(x, 'utf8')).join('\n');
|
var text = process.argv.slice(2, -1).map(x => fs.readFileSync(x, 'utf8')).join('\n');
|
||||||
text = text.replace(/\r\n/g, '\n');
|
text = text.replace(/\r\n/g, '\n');
|
||||||
|
|
||||||
var outName = process.argv[process.argv.length - 1];
|
var outName = process.argv[process.argv.length - 1];
|
||||||
fs.outputFileSync(outName, text);
|
fs.writeFileSync(outName, text);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
fs = require 'fs-extra'
|
fs = require 'fs'
|
||||||
_ = require 'lodash'
|
_ = require 'lodash'
|
||||||
|
|
||||||
# disable ES6 delimiters
|
# disable ES6 delimiters
|
||||||
@ -84,4 +84,4 @@ for arg in process.argv[4..]
|
|||||||
|
|
||||||
text = read process.argv[2]
|
text = read process.argv[2]
|
||||||
text = _.template(text)(pkg)
|
text = _.template(text)(pkg)
|
||||||
fs.outputFileSync process.argv[3], text
|
fs.writeFileSync process.argv[3], text
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user