diff --git a/Makefile b/Makefile index 021f3eb05..2b3dc5306 100644 --- a/Makefile +++ b/Makefile @@ -117,8 +117,12 @@ tmp/font-awesome.css : src/css/font-awesome.css $(imports_font_awesome) $(templa tmp/style.css : src/css/style.css $(imports_style) $(template_deps) | tmp $(template) $< $@ -tmp/declaration.js : $(wildcard src/*/*.coffee) tools/declare.js | tmp +.events/declare : $(wildcard src/*/*.coffee) tools/declare.js | .events tmp node tools/declare.js + echo -> $@ + +tmp/declaration.js : .events/declare + tmp/globals.js : src/General/globals.js version.json $(template_deps) | tmp $(template) $< $@ diff --git a/tools/declare.js b/tools/declare.js index e919adc1d..a91fd3e7c 100644 --- a/tools/declare.js +++ b/tools/declare.js @@ -7,4 +7,12 @@ for (var d of fs.readdirSync('src')) { if (m) names.push(m[1]); } } -fs.writeFileSync('tmp/declaration.js', `var ${names.sort().join(', ')};\n`); +var decl = `var ${names.sort().join(', ')};\n`; +var oldDecl; +try { + oldDecl = fs.readFileSync('tmp/declaration.js', 'utf8'); +} catch(err) { +} +if (decl !== oldDecl) { + fs.writeFileSync('tmp/declaration.js', decl, 'utf8'); +}