make watch - recompile
Automatically recompiling when a file changes is the next best thing if a repl is not possible. Luckily it's extremely easy to do on linux with inotify-tools.
Get inotify-tools
sudo apt-get install inotify-tools
Add watch to your makefile. Here is an extremely basic example,
CC=rustc
OUT=out
SRC=main.rs
CFLAGS=
all:
$(CC) $(CFLAGS) $(SRC) -o $(OUT)
clean:
rm -f $(OUT)
watch:
while true; do inotifywait $(SRC) && clear && make; done
Then just use it and make will be called every time a file is modified.
make watch
Written by ilia choly
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Make
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#