4

我正在尝试制作一个执行多个命令的 Makefile。例子:

script:
  cat scripts/*.js > public/scripts/scripts.js

vendor:
  cat vendor/*.js > public/scripts/vendor.js

watchStyles:
  stylus -w -u nib styles/styles.styl -o public/styles

watchScripts:
  watchr -e "watch('scripts/.*\.js') {system 'make scripts'}"

watchVendor:
  watchr -e "watch('vendor/.*\.js') {system 'make vendor'}"

现在我必须打开 3 个终端,这很烦人。我怎样才能只运行一个 via make watch

watch: watchStyles watchScripts watchVendor
4

1 回答 1

8

如果您使用的是 GNU make,则-j选项允许它并行构建目标,例如:

make -j4 watchStyles watchScripts watchVendor
于 2012-08-21T08:22:39.227 回答