LINUX.ORG.RU

Что-то ты не так с Makefile-ами делаешь. Они как раз и должны лежать так, по штуке на директорию.

anonymous
()
Ответ на: комментарий от anonymous

>>У меня хедеры храняться в отдельном каталоге. Не писать же для них Makefile...
>Это не комильфо.

А почему бы и нет?

anonymous
()

recompile использует директорию, в которой был вызван предыдущий compile, может это поможет.

Legioner ★★★★★
()

(defvar *project-root-dir-indicator* "root-project-dir")

;;; not too portable
(defun find-root-project-dir ()
  "Return path to root project directory"
  (loop for curdir = default-directory then (concat curdir "../")
        and
        max = 10 then (- max 1)
        while (> max 0)
        when (file-exists-p (concat curdir *project-root-dir-indicator*))
        return curdir))

;;; compilation
(defun my-save-and-compile (&rest params)
  "Saves all dirty buffers and tries to compile all the proj"
  (interactive "")
  (save-buffer 0)
  (compile
   (let ((dir (find-root-project-dir)))
     (concat "make"
             (when dir (concat " -C "
                               dir
                               " "
                               (with-temp-buffer
                                 (insert-file-contents (concat dir "/" *project-root-dir-indicator*))
                                 (buffer-string))))
             (when params (concat " " (car params)))))))
(global-set-key [(f9)] 'my-save-and-compile)


Можете заменить "root-project-dir" на Makefile, но мне кажется это
неудобным.

sf ★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.