I'm trying to make a Makefile that executes multiple commands. Example:
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'}"
Right now I have to open up 3 terminals, which is annoying. How can I run only one via make watch
?
watch: watchStyles watchScripts watchVendor
If you are using GNU make then -j
option allows it to build targets in parallel, e.g.:
make -j4 watchStyles watchScripts watchVendor
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With