aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cedet/ede
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2009-10-17 04:18:31 +0000
committerChong Yidong <[email protected]>2009-10-17 04:18:31 +0000
commit67d3ffe4989e99079a69e1f7358b758c14cb519a (patch)
treeef5228be15780a5eae1d81245c0b136e1101e123 /lisp/cedet/ede
parent2df48a87291564f460b159f94f622f88f6c40bfb (diff)
* cedet/srecode/srt.el:
* cedet/srecode/compile.el: * cedet/semantic/mru-bookmark.el: * cedet/semantic/debug.el: * cedet/semantic/complete.el: * cedet/semantic/analyze.el: Require CL when compiling. * cedet/semantic/scope.el (semantic-analyze-scoped-inherited-tag-map): Wrap calculation of tmpscope so that the regular scope will continue to work. * cedet/semantic/idle.el (semantic-idle-tag-highlight): Use semantic-idle-summary-highlight-face as the highlighting. * emacs-lisp/eieio-base.el (eieio-persistent-save): If buffer contains multibyte characters, choose first applicable coding system automatically. * cedet/ede/project-am.el (project-run-target): New method. (project-run-target): New method. * cedet/ede.el (ede-target): Add run target menu item. (ede-project, ede-minor-keymap): Add ede-run-target binding. (ede-run-target): New function. (ede-target::project-run-target): New method. * cedet/ede/proj.el (project-run-target): New method. * cedet/ede/proj-shared.el (ede-gcc-libtool-shared-compiler) (ede-g++-libtool-shared-compiler): Remove SHELL. Remove COMMANDS. Add :rules. (ede-proj-target-makefile-shared-object): Only libtool compilers now available. Add linkers for libtool. (ede-cc-linker-libtool, ede-g++-linker-libtool): New. (ede-proj-makefile-target-name): Always use .la extension. * cedet/ede/proj-prog.el (project-run-target): New method. * cedet/ede/proj-obj.el (ede-cc-linker): Rename from ede-gcc-linker. (ede-g++-linker): Change Change link lines. * cedet/ede/pmake.el (ede-pmake-insert-variable-shared): When searching for old variables, go to the end of the buffer and search backward from there. (ede-proj-makefile-automake-insert-subdirs) (ede-proj-makefile-automake-insert-extradist): New methods. (ede-proj-makefile-create): Use them. * cedet/ede/pconf.el (ede-proj-configure-test-required-file): Force FILE to expand to the current target. Use file-exists-p to check that it exists. * cedet/ede/linux.el (ede-linux-version): Don't call "head". (ede-linux-load): Wrap dir in file-name-as-directory. Set :version slot. * cedet/ede/files.el (ede-get-locator-object): When enabling locate, do so on "top". * cedet/ede/emacs.el (ede-emacs-file-existing): Wrap "dir" in file-name-as-directory during compare. (ede-emacs-version): Return Emacs/XEmacs differentiator. Get version number from different places. Don't call egrep. (ede-emacs-load): Set :version slot. Call file-name-as-directory to set the directory. * cedet/ede/shell.el: New file. * cedet/inversion.el (inversion-decoders): Allow for stray . in alpha/beta variants.
Diffstat (limited to 'lisp/cedet/ede')
-rw-r--r--lisp/cedet/ede/emacs.el56
-rw-r--r--lisp/cedet/ede/files.el2
-rw-r--r--lisp/cedet/ede/linux.el7
-rw-r--r--lisp/cedet/ede/pconf.el32
-rw-r--r--lisp/cedet/ede/pmake.el21
-rw-r--r--lisp/cedet/ede/proj-comp.el1
-rw-r--r--lisp/cedet/ede/proj-misc.el1
-rw-r--r--lisp/cedet/ede/proj-obj.el9
-rw-r--r--lisp/cedet/ede/proj-prog.el23
-rw-r--r--lisp/cedet/ede/proj-shared.el74
-rw-r--r--lisp/cedet/ede/proj.el4
-rw-r--r--lisp/cedet/ede/project-am.el16
-rw-r--r--lisp/cedet/ede/shell.el83
-rw-r--r--lisp/cedet/ede/speedbar.el2
14 files changed, 277 insertions, 54 deletions
diff --git a/lisp/cedet/ede/emacs.el b/lisp/cedet/ede/emacs.el
index edd499eb2b..a38e6a0ef0 100644
--- a/lisp/cedet/ede/emacs.el
+++ b/lisp/cedet/ede/emacs.el
@@ -48,7 +48,8 @@ DIR is the directory to search from."
(ans nil))
(while (and projs (not ans))
(let ((root (ede-project-root-directory (car projs))))
- (when (string-match (concat "^" (regexp-quote root)) dir)
+ (when (string-match (concat "^" (regexp-quote root))
+ (file-name-as-directory dir))
(setq ans (car projs))))
(setq projs (cdr projs)))
ans))
@@ -70,19 +71,44 @@ DIR is the directory to search from."
base))))))
(defun ede-emacs-version (dir)
- "Find the Emacs version for the Emacs src in DIR."
- (let ((buff (get-buffer-create " *emacs-query*")))
+ "Find the Emacs version for the Emacs src in DIR.
+Return a tuple of ( EMACSNAME . VERSION )."
+ (let ((buff (get-buffer-create " *emacs-query*"))
+ (emacs "Emacs")
+ (ver ""))
(save-excursion
(set-buffer buff)
(erase-buffer)
(setq default-directory (file-name-as-directory dir))
- (call-process "egrep" nil buff nil "-n" "-e" "^version=" "Makefile")
+ ;(call-process "egrep" nil buff nil "-n" "-e" "^version=" "Makefile")
+ (call-process "egrep" nil buff nil "-n" "-e" "AC_INIT" "configure.in")
(goto-char (point-min))
- (re-search-forward "version=\\([0-9.]+\\)")
- (prog1
- (match-string 1)
- (kill-buffer buff)
- ))))
+ ;(re-search-forward "version=\\([0-9.]+\\)")
+ (cond
+ ;; Maybe XEmacs?
+ ((file-exists-p "version.sh")
+ (setq emacs "XEmacs")
+ (insert-file-contents "version.sh")
+ (goto-char (point-min))
+ (re-search-forward "emacs_major_version=\\([0-9]+\\)
+emacs_minor_version=\\([0-9]+\\)
+emacs_beta_version=\\([0-9]+\\)")
+ (setq ver (concat (match-string 1) "."
+ (match-string 2) "."
+ (match-string 3)))
+ )
+ ;; Insert other Emacs here...
+
+ ;; Vaguely recent version of GNU Emacs?
+ (t
+ (insert-file-contents "configure.in")
+ (goto-char (point-min))
+ (re-search-forward "AC_INIT(emacs,\\s-*\\([0-9.]+\\)\\s-*)")
+ (setq ver (match-string 1))
+ )
+ )
+ ;; Return a tuple
+ (cons emacs ver))))
(defclass ede-emacs-project (ede-project eieio-instance-tracker)
((tracking-symbol :initform 'ede-emacs-project-list)
@@ -97,11 +123,13 @@ Argument DIR is the directory it is created for.
ROOTPROJ is nil, since there is only one project."
(or (ede-emacs-file-existing dir)
;; Doesn't already exist, so lets make one.
- (ede-emacs-project "Emacs"
- :name (concat "Emacs" (ede-emacs-version dir))
- :directory dir
- :file (expand-file-name "src/emacs.c"
- dir))
+ (let* ((vertuple (ede-emacs-version dir)))
+ (ede-emacs-project (car vertuple)
+ :name (car vertuple)
+ :version (cdr vertuple)
+ :directory (file-name-as-directory dir)
+ :file (expand-file-name "src/emacs.c"
+ dir)))
(ede-add-project-to-global-list this)
)
)
diff --git a/lisp/cedet/ede/files.el b/lisp/cedet/ede/files.el
index 2a886758a2..980d98b316 100644
--- a/lisp/cedet/ede/files.el
+++ b/lisp/cedet/ede/files.el
@@ -396,7 +396,7 @@ Get it from the toplevel project. If it doesn't have one, make one."
;; caching values, and for locating things more robustly.
(let ((top (ede-toplevel proj)))
(when (not (slot-boundp top 'locate-obj))
- (ede-enable-locate-on-project this))
+ (ede-enable-locate-on-project top))
(oref top locate-obj)
))
diff --git a/lisp/cedet/ede/linux.el b/lisp/cedet/ede/linux.el
index 400aaa6997..c80902bf0b 100644
--- a/lisp/cedet/ede/linux.el
+++ b/lisp/cedet/ede/linux.el
@@ -76,7 +76,7 @@ DIR is the directory to search from."
(set-buffer buff)
(erase-buffer)
(setq default-directory (file-name-as-directory dir))
- (call-process "head" nil buff nil "-n" "3" "Makefile")
+ (insert-file-contents "Makefile" nil 0 512)
(goto-char (point-min))
(let (major minor sub)
(re-search-forward "^VERSION *= *\\([0-9.]+\\)")
@@ -104,8 +104,9 @@ ROOTPROJ is nil, since there is only one project."
(or (ede-linux-file-existing dir)
;; Doesn't already exist, so lets make one.
(ede-linux-project "Linux"
- :name (concat "Linux" (ede-linux-version dir))
- :directory dir
+ :name "Linux"
+ :version (ede-linux-version dir)
+ :directory (file-name-as-directory dir)
:file (expand-file-name "scripts/ver_linux"
dir))
(ede-add-project-to-global-list this)
diff --git a/lisp/cedet/ede/pconf.el b/lisp/cedet/ede/pconf.el
index 7544f85405..216da94096 100644
--- a/lisp/cedet/ede/pconf.el
+++ b/lisp/cedet/ede/pconf.el
@@ -42,21 +42,22 @@ don't do it. A value of nil means to just do it.")
(defmethod ede-proj-configure-test-required-file ((this ede-proj-project) file)
"For project THIS, test that the file FILE exists, or create it."
- (when (not (ede-expand-filename (ede-toplevel this) file))
- (save-excursion
- (find-file (ede-expand-filename (ede-toplevel this) file t))
- (cond ((string= file "AUTHORS")
- (insert (user-full-name) " <" (user-login-name) ">"))
- ((string= file "NEWS")
- (insert "NEWS file for " (ede-name this)))
- (t (insert "\n")))
- (save-buffer)
- (when
- (and (eq ede-pconf-create-file-query 'ask)
- (not (eq ede-pconf-create-file-query 'never))
- (not (y-or-n-p
- (format "I had to create the %s file for you. Ok? " file)))
- (error "Quit"))))))
+ (let ((f (ede-expand-filename (ede-toplevel this) file t)))
+ (when (not (file-exists-p f))
+ (save-excursion
+ (find-file f)
+ (cond ((string= file "AUTHORS")
+ (insert (user-full-name) " <" (user-login-name) ">"))
+ ((string= file "NEWS")
+ (insert "NEWS file for " (ede-name this)))
+ (t (insert "\n")))
+ (save-buffer)
+ (when
+ (and (eq ede-pconf-create-file-query 'ask)
+ (not (eq ede-pconf-create-file-query 'never))
+ (not (y-or-n-p
+ (format "I had to create the %s file for you. Ok? " file)))
+ (error "Quit")))))))
(defmethod ede-proj-configure-synchronize ((this ede-proj-project))
@@ -100,6 +101,7 @@ don't do it. A value of nil means to just do it.")
;; Now save
(save-buffer)
(setq postcmd "autoreconf -i;")
+
;; Verify a bunch of files that are required by automake.
(ede-proj-configure-test-required-file this "AUTHORS")
(ede-proj-configure-test-required-file this "NEWS")
diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el
index a8b16dce13..6ded4be283 100644
--- a/lisp/cedet/ede/pmake.el
+++ b/lisp/cedet/ede/pmake.el
@@ -44,6 +44,7 @@
;; 1) Insert distribution source variables for targets
;; 2) Insert user requested rules
+(eval-when-compile (require 'cl))
(require 'ede/proj)
(require 'ede/proj-obj)
(require 'ede/proj-comp)
@@ -205,6 +206,9 @@ MFILENAME is the makefile to generate."
(error "Makefile.in is not supported"))
((eq (oref this makefile-type) 'Makefile.am)
(require 'ede/pconf)
+ ;; Basic vars needed:
+ (ede-proj-makefile-automake-insert-subdirs this)
+ (ede-proj-makefile-automake-insert-extradist this)
;; Distribution variables
(let ((targ (if isdist (oref this targets) mt)))
(ede-compiler-begin-unique
@@ -240,8 +244,11 @@ MFILENAME is the makefile to generate."
"Add VARNAME into the current Makefile.
Execute BODY in a location where a value can be placed."
`(let ((addcr t) (v ,varname))
- (if (re-search-backward (concat "^" v "\\s-*=") nil t)
+ (if (save-excursion
+ (goto-char (point-max))
+ (re-search-backward (concat "^" v "\\s-*=") nil t))
(progn
+ (goto-char (match-end 0))
(ede-pmake-end-of-variable)
(if (< (current-column) 40)
(if (and (/= (preceding-char) ?=)
@@ -502,6 +509,18 @@ Argument THIS is the target that should insert stuff."
(ede-proj-makefile-insert-dist-dependencies this)
)
+(defmethod ede-proj-makefile-automake-insert-subdirs ((this ede-proj-project))
+ "Insert a SUBDIRS variable for Automake."
+ (proj-comp-insert-variable-once "SUBDIRS"
+ (ede-map-subprojects
+ this (lambda (sproj)
+ (insert " " (ede-subproject-relative-path sproj))
+ ))))
+
+(defmethod ede-proj-makefile-automake-insert-extradist ((this ede-proj-project))
+ "Insert the EXTRADIST variable entries needed for Automake and EDE."
+ (proj-comp-insert-variable-once "EXTRA_DIST" (insert "Project.ede")))
+
(defmethod ede-proj-makefile-insert-dist-rules ((this ede-proj-project))
"Insert distribution rules for THIS in a Makefile, such as CLEAN and DIST."
(let ((junk (ede-proj-makefile-garbage-patterns this))
diff --git a/lisp/cedet/ede/proj-comp.el b/lisp/cedet/ede/proj-comp.el
index 376c48f9c1..4d46272728 100644
--- a/lisp/cedet/ede/proj-comp.el
+++ b/lisp/cedet/ede/proj-comp.el
@@ -44,6 +44,7 @@
;; To write a method that inserts a variable or rule for a compiler
;; based object, wrap the body of your call in `ede-compiler-only-once'
+(eval-when-compile (require 'cl))
(require 'ede) ;source object
(require 'ede/autoconf-edit)
diff --git a/lisp/cedet/ede/proj-misc.el b/lisp/cedet/ede/proj-misc.el
index 5907dcd5d4..498e9a43c0 100644
--- a/lisp/cedet/ede/proj-misc.el
+++ b/lisp/cedet/ede/proj-misc.el
@@ -27,6 +27,7 @@
;; This misc target lets the user link in custom makefiles to an EDE
;; project.
+(eval-when-compile (require 'cl))
(require 'ede/pmake)
(require 'ede/proj-comp)
diff --git a/lisp/cedet/ede/proj-obj.el b/lisp/cedet/ede/proj-obj.el
index f3ededad89..85ba47fb47 100644
--- a/lisp/cedet/ede/proj-obj.el
+++ b/lisp/cedet/ede/proj-obj.el
@@ -26,6 +26,7 @@
;; Handles a superclass of target types which create object code in
;; and EDE Project file.
+(eval-when-compile (require 'cl))
(require 'ede/proj)
(declare-function ede-pmake-varname "ede/pmake")
@@ -46,7 +47,7 @@
;; fortran or pascal can be added here
))
(availablelinkers :initform (ede-g++-linker
- ede-gcc-linker
+ ede-cc-linker
ede-gfortran-linker
ede-ld-linker
;; Add more linker thingies here.
@@ -108,10 +109,10 @@ file.")
:uselinker t)
"Compiler for C sourcecode.")
-(defvar ede-gcc-linker
+(defvar ede-cc-linker
(ede-linker
- "ede-gcc-linker"
- :name "gcc"
+ "ede-cc-linker"
+ :name "cc"
:sourcetype '(ede-source-c)
:variables '(("C_LINK" . "$(CC) $(CFLAGS) $(LDFLAGS) -L."))
:commands '("$(C_LINK) -o $@ $^")
diff --git a/lisp/cedet/ede/proj-prog.el b/lisp/cedet/ede/proj-prog.el
index da99acd6f9..4b0843e140 100644
--- a/lisp/cedet/ede/proj-prog.el
+++ b/lisp/cedet/ede/proj-prog.el
@@ -25,9 +25,12 @@
;;
;; Handle building programs from object files in and EDE Project file.
+(eval-when-compile (require 'cl))
(require 'ede/pmake)
(require 'ede/proj-obj)
+(declare-function ede-shell-run-something "ede/shell")
+
;;; Code:
(defclass ede-proj-target-makefile-program
(ede-proj-target-makefile-objectcode)
@@ -107,6 +110,26 @@ Note: Not currently used. This bug needs to be fixed.")
(funcall ede-debug-program-function cmd))
(kill-buffer tb))))
+(defmethod project-run-target ((obj ede-proj-target-makefile-program) &optional command)
+ "Run a program target OBJ.
+Optional COMMAND is the command to run in place of asking the user."
+ (require 'ede/shell)
+ (let ((tb (get-buffer-create " *padt*"))
+ (dd (if (not (string= (oref obj path) ""))
+ (oref obj path)
+ default-directory))
+ (cmd nil))
+ (unwind-protect
+ (progn
+ (set-buffer tb)
+ (setq default-directory dd)
+ (setq cmd (or command
+ (read-from-minibuffer
+ "Run (like this): "
+ (concat "./" (ede-target-name obj)))))
+ (ede-shell-run-something obj cmd)
+ )
+ (kill-buffer tb))))
(provide 'ede/proj-prog)
diff --git a/lisp/cedet/ede/proj-shared.el b/lisp/cedet/ede/proj-shared.el
index 37aeb72304..2db616cfeb 100644
--- a/lisp/cedet/ede/proj-shared.el
+++ b/lisp/cedet/ede/proj-shared.el
@@ -26,6 +26,7 @@
;; Tries to deal with libtool and non-libtool situations.
(require 'ede/pmake)
+(require 'ede/proj-obj)
(require 'ede/proj-prog)
;;; THIS NEEDS WORK. SEE ede-proj-obj.
@@ -33,11 +34,15 @@
;;; Code:
(defclass ede-proj-target-makefile-shared-object
(ede-proj-target-makefile-program)
- ((availablecompilers :initform (ede-gcc-shared-compiler
- ede-gcc-libtool-shared-compiler
- ede-g++-shared-compiler
+ ((availablecompilers :initform (ede-gcc-libtool-shared-compiler
+ ;;ede-gcc-shared-compiler
ede-g++-libtool-shared-compiler
+ ;;ede-g++-shared-compiler
))
+ (availablelinkers :initform (ede-cc-linker-libtool
+ ede-g++-linker-libtool
+ ;; Add more linker thingies here.
+ ))
(ldflags :custom (repeat (string :tag "Libtool flag"))
:documentation
"Additional flags to add when linking this shared library.
@@ -65,16 +70,37 @@ Use ldlibs to add addition libraries.")
(clone ede-gcc-shared-compiler
"ede-c-shared-compiler-libtool"
:name "libtool"
- :variables '(("LIBTOOL" . "$(SHELL) libtool")
+ :variables '(("LIBTOOL" . "libtool")
("LTCOMPILE" . "$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)")
("LTLINK" . "$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@")
)
- :commands '("$(LTLINK) $^"
- )
+ :rules (list (ede-makefile-rule
+ "cc-inference-rule-libtool"
+ :target "%.o"
+ :dependencies "%.c"
+ :rules '("@echo '$(LTCOMPILE) -o $@ $<'; \\"
+ "$(LTCOMPILE) -o $@ $<"
+ )
+ ))
:autoconf '("AC_PROG_LIBTOOL")
)
"Compiler for C sourcecode.")
+(defvar ede-cc-linker-libtool
+ (clone ede-cc-linker
+ "ede-cc-linker-libtool"
+ :name "cc shared"
+ ;; Only use this linker when c++ exists.
+ :sourcetype '(ede-source-c++)
+ :variables '(
+ ("LIBTOOL" . "libtool")
+ ("LTLINK" . "$(LIBTOOL) --tag=CPP --mode=link $(CPP) $(CFLAGS) $(LDFLAGS) -L. -o $@")
+ )
+ :commands '("$(LTLINK) -o $@ $^")
+ :autoconf '("AC_PROG_LIBTOOL")
+ :objectextention ".la")
+ "Linker needed for c++ programs.")
+
(defvar ede-g++-shared-compiler
(clone ede-g++-compiler
"ede-c++-shared-compiler"
@@ -92,16 +118,36 @@ Use ldlibs to add addition libraries.")
"ede-c++-shared-compiler-libtool"
:name "libtool"
:variables '(("CXX" "g++")
- ("LIBTOOL" . "$(SHELL) libtool")
- ("LTCOMPILE" . "$(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)")
- ("LTLINK" . "$(LIBTOOL) --mode=link $(CXX) $(CFLAGS) $(LDFLAGS) -L. -o $@")
+ ("LIBTOOL" . "libtool")
+ ("LTCOMPILE" . "$(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)")
)
- :commands '("$(LTLINK) $^"
- )
+ :rules (list (ede-makefile-rule
+ "c++-inference-rule-libtool"
+ :target "%.o"
+ :dependencies "%.c"
+ :rules '("@echo '$(LTCOMPILE) -o $@ $<'; \\"
+ "$(LTCOMPILE) -o $@ $<"
+ )
+ ))
:autoconf '("AC_PROG_LIBTOOL")
)
"Compiler for C sourcecode.")
+(defvar ede-g++-linker-libtool
+ (clone ede-g++-linker
+ "ede-g++-linker-libtool"
+ :name "g++"
+ ;; Only use this linker when c++ exists.
+ :sourcetype '(ede-source-c++)
+ :variables '(
+ ("LIBTOOL" . "libtool")
+ ("LTLINK" . "$(LIBTOOL) --tag=CXX --mode=link $(CXX) $(CFLAGS) $(LDFLAGS) -L. -o $@")
+ )
+ :commands '("$(LTLINK) -o $@ $^")
+ :autoconf '("AC_PROG_LIBTOOL")
+ :objectextention ".la")
+ "Linker needed for c++ programs.")
+
;;; @TODO - C++ versions of the above.
(when nil
@@ -150,11 +196,7 @@ We need to override -program which has an LDADD element."
"Return the name of the main target for THIS target."
;; We need some platform gunk to make the .so change to .sl, or .a,
;; depending on the platform we are going to compile against.
- (concat "lib" (ede-name this)
- (if (eq (oref (ede-target-parent this) makefile-type)
- 'Makefile.am)
- ".la"
- ".so")))
+ (concat "lib" (ede-name this) ".la"))
(defmethod ede-proj-makefile-sourcevar ((this ede-proj-target-makefile-shared-object))
"Return the variable name for THIS's sources."
diff --git a/lisp/cedet/ede/proj.el b/lisp/cedet/ede/proj.el
index bf50fe6360..046567fe83 100644
--- a/lisp/cedet/ede/proj.el
+++ b/lisp/cedet/ede/proj.el
@@ -498,6 +498,10 @@ Optional argument COMMAND is the s the alternate command to use."
"Run the current project target OBJ in a debugger."
(error "Debug-target not supported by %s" (object-name obj)))
+(defmethod project-run-target ((obj ede-proj-target))
+ "Run the current project target OBJ."
+ (error "Run-target not supported by %s" (object-name obj)))
+
(defmethod ede-proj-makefile-target-name ((this ede-proj-target))
"Return the name of the main target for THIS target."
(ede-name this))
diff --git a/lisp/cedet/ede/project-am.el b/lisp/cedet/ede/project-am.el
index 4c480271e0..50436f214f 100644
--- a/lisp/cedet/ede/project-am.el
+++ b/lisp/cedet/ede/project-am.el
@@ -392,6 +392,7 @@ Argument COMMAND is the command to use for compiling the target."
(cmd nil))
(unwind-protect
(progn
+ (require 'ede/shell)
(set-buffer tb)
(setq default-directory dd)
(setq cmd (read-from-minibuffer
@@ -401,6 +402,21 @@ Argument COMMAND is the command to use for compiling the target."
(funcall project-am-debug-target-function cmd))
(kill-buffer tb))))
+(defmethod project-run-target ((obj project-am-objectcode))
+ "Run the current project target in comint buffer."
+ (let ((tb (get-buffer-create " *padt*"))
+ (dd (oref obj path))
+ (cmd nil))
+ (unwind-protect
+ (progn
+ (set-buffer tb)
+ (setq default-directory dd)
+ (setq cmd (read-from-minibuffer
+ "Run (like this): "
+ (concat (ede-target-name obj))))
+ (ede-shell-run-something obj cmd))
+ (kill-buffer tb))))
+
(defmethod project-make-dist ((this project-am-target))
"Run the current project in the debugger."
(require 'compile)
diff --git a/lisp/cedet/ede/shell.el b/lisp/cedet/ede/shell.el
new file mode 100644
index 0000000000..0d05d238e3
--- /dev/null
+++ b/lisp/cedet/ede/shell.el
@@ -0,0 +1,83 @@
+;;; ede/shell.el --- A shell controlled by EDE.
+;;
+;; Copyright (C) 2009 Free Software Foundation, Inc.
+;;
+;; Author: Eric M. Ludlam <[email protected]>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Run commands through a specialized EDE shell buffer. Commands will
+;; be run as shell commands so users can type in their own thing in
+;; the shells for testing purposes.
+;;
+;; Each thing that EDE wants to use will create a shell to interact with it.
+
+;;; Code:
+
+(require 'ede)
+
+(declare-function comint-send-input "comint")
+
+(defmethod ede-shell-run-something ((target ede-target) command)
+ "Create a shell to run stuff for TARGET.
+COMMAND is a text string representing the thing to be run."
+ (let* ((buff (ede-shell-buffer target))
+ (cp (ede-target-parent target))
+ (dd (oref cp :directory)))
+ ;; Show the new buffer.
+ (when (not (get-buffer-window buff))
+ (switch-to-buffer-other-window buff t))
+ ;; Force a shell into the buffer.
+ (shell buff)
+ (while (eq (point-min) (point))
+ (accept-process-output))
+ ;; Change the default directory
+ (if (not (string= (file-name-as-directory (expand-file-name default-directory))
+ (file-name-as-directory (expand-file-name dd))))
+ ;; Go there.
+ (setq command (concat (concat "cd " dd ";" command))))
+ ;; Run the command itself.
+ (ede-shell-run-command command)
+ ))
+
+(defun ede-shell-run-command (command)
+ "Run the COMMAND in the current shell-buffer."
+ (require 'comint)
+ ;; go to end
+ (goto-char (point-max))
+ ;; Insert the stuff.
+ (goto-char (point-max))
+ (insert command)
+ ;; Send the command.
+ (comint-send-input)
+ )
+
+(defmethod ede-shell-buffer ((target ede-target))
+ "Get the buffer for running shell commands for TARGET."
+ (let ((name (ede-name target)))
+ (get-buffer-create (format "*EDE Shell %s" name))))
+
+(provide 'ede/shell)
+
+;; Local variables:
+;; generated-autoload-file: "loaddefs.el"
+;; generated-autoload-feature: ede/loaddefs
+;; generated-autoload-load-name: "ede/shell"
+;; End:
+
+;;; ede/shell.el ends here
diff --git a/lisp/cedet/ede/speedbar.el b/lisp/cedet/ede/speedbar.el
index 93bb50137c..cc54128a09 100644
--- a/lisp/cedet/ede/speedbar.el
+++ b/lisp/cedet/ede/speedbar.el
@@ -27,6 +27,8 @@
;;
;;; Code:
+
+(eval-when-compile (require 'cl))
(require 'speedbar)
(require 'eieio-speedbar)
(require 'ede)