make-watch

0.0.2 • Public • Published

make-watch

Build Status npm version npm downloads MIT

Continuously run Make in watch mode


Attention - This project isn't completed yet. Feel free to contribute with code, tests or documentation.


Motivation

Sometimes while developing we want to recompile a file or rerun all tests when something changes. make-watch allows you to run a make command automatically everytime that one of its dependency changes. How? make-watch analyzes your Makefile and extracts a dependency graph, so it can watch all and only the interested files. You no longer need to manually run commands if you change a file or the Makefile itself.

Installation

You can install make-watch using npm:

npm install --save-dev make-watch

or, if you prefer, you can install make-watch globally with:

npm install -g make-watch

Usage

Once you have installed make-watch, you can use it from the command line. Just replace make with make-watch. Here is an example:

# make
make-watch

# make target1.exe target2.exe
make-watch target1.exe target2.exe

# make target1.exe target2.exe
# also watch .cpp files in src and lib dir except config.cpp
# this is useful if you want to recompile your app
# when you create a new file for example
make-watch target1.exe target2.exe -I "src","lib" -x ".cpp" -i "config.cpp"

Options

Option Default Description
-V, --version output the version number
-I, --include <files_and_dirs> list of additional files and directoris to watch
-x, --extensions <extensions> list of extensions to hook into
-i, --ignore <regex> ignore all additional files and directories that match this regex
--no-makewatchrc whether or not to look up .makewatchrc
-h, --help output usage information

makewatchrc

Instead of cli options, you can use a .makewatchrc json file, here is an example:

{
  "include": ["src", "lib"],
  "extensions": [".cpp"],
  "ignore": "ignore.cpp"
}

make-watch will lookup to a .makewatchrc in the current directory. If one does not exist, it will travel up the directory tree trying to find it.

Change Log

This project adheres to Semantic Versioning.
Every release, along with the migration instructions, is documented on the Github Releases page.

Authors

Matteo Basso

Copyright and License

Copyright (c) 2017, Matteo Basso.

make-watch source code is licensed under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i make-watch

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

59.6 kB

Total Files

21

Last publish

Collaborators

  • mbasso