2017-09-25 13:06:08 +02:00
|
|
|
;;; tools/make/autoload.el -*- lexical-binding: t; -*-
|
|
|
|
|
2018-04-20 04:14:30 -04:00
|
|
|
(require 'makefile-executor)
|
|
|
|
|
2017-09-25 13:06:08 +02:00
|
|
|
;;;###autoload
|
|
|
|
(defun +make/run ()
|
2018-04-20 04:14:30 -04:00
|
|
|
"Run a make task in the current project. If multiple makefiles are available,
|
|
|
|
you'll be prompted to select one."
|
|
|
|
(interactive)
|
|
|
|
(if (doom-project-p 'nocache)
|
|
|
|
(makefile-executor-execute-project-target)
|
|
|
|
(let ((makefile (cl-loop with buffer-file = (or buffer-file-name default-directory)
|
|
|
|
for file in (list "Makefile" "makefile")
|
|
|
|
if (locate-dominating-file buffer-file file)
|
|
|
|
return file)))
|
|
|
|
(unless makefile
|
|
|
|
(user-error "Cannot find a makefile in the current project"))
|
|
|
|
(let ((default-directory (file-name-directory makefile)))
|
|
|
|
(makefile-executor-execute-target makefile)))))
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun +make/run-last ()
|
|
|
|
"TODO"
|
2017-09-25 13:06:08 +02:00
|
|
|
(interactive)
|
2018-04-20 04:14:30 -04:00
|
|
|
(makefile-executor-execute-last nil))
|