Olivia5k / makefile-executor.el

Emacs helpers to run things from makefiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support `universal-argument` for `makefile-executor-execute-target` 's `compile` action

eval-exec opened this issue · comments

Hello, some makefile target need user input, so it would be nice if makefile-executor-execute-target can support universal-argument like C-u compile.

(defun makefile-executor-execute-target (filename &optional target)
  "Execute a Makefile target from FILENAME.

FILENAME defaults to current buffer."
  (interactive
   (list (file-truename buffer-file-name)))

  (let ((target (or target (makefile-executor-select-target filename))))
    (makefile-executor-store-cache filename target)
    (compile (format "make -f %s -C %s %s"
                     (shell-quote-argument filename)
                     (shell-quote-argument (file-name-directory filename))
                     target))))

The compile may need to accept optional _COMINT argument:

(compile COMMAND &optional _COMINT)