GNU make is a powerful tool as GNU Emacs compile mode. This package helps to merge them into a powerful interface.
Just run make-project-run
interactive function and select make target.
Each target will have an annotation with prerequisites (if exist) and a commment
Given the following Makefile
:
# This comment will be ignored
# Foo target
foo:
echo "foo"
bar: foo
echo "bar"
# Comment for the baz target
baz: foo bar
echo "baz"
Invoke make-project-run
:
https://i.imgur.com/WHyP3Yq.png
Using default package.el
starting from GNU Emacs 29.1
(use-package
make-project
:vc (:url "https://github.com/scipunch/make-project"))
It requires Tree-Sitter grammar for make as well:
(add-to-list
treesit-language-source-alist
(make "https://github.com/alemuller/tree-sitter-make"))
(treesit-install-language-grammar 'make)