Hi Eric and others,
I wonder if you would consider taking in that patch, which provides simple
target and project compilation commands for linux kernel.
As I'm much more confortable with Linux kernel than with elisp code, feel free
to comment and/or change the submitted patch.
Cheers.
--
Robert
---
>From b4ad4f28d8354e725c2b30bbb76909f64a64f14b Mon Sep 17 00:00:00 2001
From: Robert Jarzmik <robert.jarzmik@...>
Date: Mon, 18 Jul 2011 21:26:55 +0200
Subject: [PATCH] ede-linux: add support for target and project compilation
Add support to :
- compile a target (ie. a Linux kernel directory)
- compile the whole project (ie. a full Linux kernel)
---
site-elisp/cedet-1.0/ede/ede-linux.el | 52 +++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/site-elisp/cedet-1.0/ede/ede-linux.el b/site-elisp/cedet-1.0/ede/ede-linux.el
index 250c744..ab28b6c 100644
--- a/site-elisp/cedet-1.0/ede/ede-linux.el
+++ b/site-elisp/cedet-1.0/ede/ede-linux.el
@@ -34,8 +34,25 @@
;; * Add website
(require 'ede)
+(require 'ede-make)
;;; Code:
+(defgroup project-linux nil
+ "File and tag browser frame."
+ :group 'tools
+ :group 'ede
+ )
+
+(defcustom project-linux-compile-target-command (concat ede-make-command " -k -C %s SUBDIRS=%s")
+ "*Default command used to compile a target."
+ :group 'project-linux
+ :type 'string)
+
+(defcustom project-linux-compile-project-command (concat ede-make-command " -k -C %s")
+ "*Default command used to compile a project."
+ :group 'project-linux
+ :type 'string)
+
(defvar ede-linux-project-list nil
"List of projects created by option `ede-linux-project'.")
@@ -237,6 +254,41 @@ Knows about how the Linux source tree is organized."
)
(or F (call-next-method))))
+(defmethod project-compile-project ((proj ede-linux-project)
+ &optional command)
+ "Compile the entire current project.
+Argument COMMAND is the command to use when compiling."
+ (let* ((dir (ede-project-root-directory proj)))
+
+ (require 'compile)
+ (if (not project-linux-compile-project-command)
+ (setq project-linux-compile-project-command compile-command))
+ (if (not command)
+ (setq command
+ (format
+ project-linux-compile-project-command
+ dir)))
+
+ (compile command)))
+
+(defmethod project-compile-target ((obj ede-linux-target-c) &optional command)
+ "Compile the current target.
+Argument COMMAND is the command to use for compiling the target."
+ (let* ((proj (ede-target-parent obj))
+ (root (ede-project-root proj))
+ (dir (ede-project-root-directory root))
+ (subdir (oref obj path)))
+
+ (require 'compile)
+ (if (not project-linux-compile-project-command)
+ (setq project-linux-compile-project-command compile-command))
+ (if (not command)
+ (setq command
+ (format
+ project-linux-compile-target-command
+ dir subdir)))
+
+ (compile command)))
(provide 'ede-linux)
;;; ede-linux.el ends here
--
1.7.4.4
|