This extension provides a way to run a shell command after updating a buffer. So you can have a shell script which makes and runs a C program, and then you would M-x watch-buffer, enter the shell script to run, and every time you save the file it will run the shell script asynchronously in a separate buffer. (watch-command "<command>") and (unwatch-command) can also be called from elisp, and will operate on the current buffer. Use `with-current-buffer' to invoke them on other buffers.
amitp/watch-buffer
watch-buffer.el is a simple way to run a shell command each time an emacs buffer is saved.
Emacs Lisp