Makefile 565 B

12345678910111213141516
  1. default: parser
  2. PEGJS = node_modules/.bin/pegjs --cache --export-var 'var result'
  3. CJSIFY = node_modules/.bin/cjsify
  4. parser: parser.js
  5. browser: dist/esquery.min.js
  6. parser.js: grammar.pegjs
  7. $(PEGJS) <"$<" >"$@"
  8. @echo 'if (typeof define === "function" && define.amd) { define(function(){ return result; }); } else if (typeof module !== "undefined" && module.exports) { module.exports = result; } else { this.esquery = result; }' >> "$@"
  9. dist/esquery.min.js: esquery.js parser.js
  10. @mkdir -p "$(@D)"
  11. $(CJSIFY) esquery.js -mvx esquery --source-map "$@.map" > "$@"