summaryrefslogtreecommitdiff
path: root/lisp/cedet/ede
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cedet/ede')
-rw-r--r--lisp/cedet/ede/cpp-root.el4
-rw-r--r--lisp/cedet/ede/pmake.el36
-rw-r--r--lisp/cedet/ede/proj-comp.el12
-rw-r--r--lisp/cedet/ede/srecode.el28
4 files changed, 39 insertions, 41 deletions
diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el
index e1e348ac947..c30df8dbb0d 100644
--- a/lisp/cedet/ede/cpp-root.el
+++ b/lisp/cedet/ede/cpp-root.el
@@ -491,8 +491,8 @@ Also set up the lexical preprocessor map."
(when (not table)
(message "Cannot find file %s in project." F))
(when (and table (semanticdb-needs-refresh-p table))
- (semanticdb-refresh-table table))
- (setq spp (append spp (oref table lexical-table)))))
+ (semanticdb-refresh-table table)
+ (setq spp (append spp (oref table lexical-table))))))
(oref this spp-files))
spp))
diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el
index 4d3f8484ddd..79775429130 100644
--- a/lisp/cedet/ede/pmake.el
+++ b/lisp/cedet/ede/pmake.el
@@ -240,20 +240,32 @@ 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)
- (progn
- (ede-pmake-end-of-variable)
- (if (< (current-column) 40)
- (if (and (/= (preceding-char) ?=)
- (/= (preceding-char) ? ))
- (insert " "))
- (insert "\\\n "))
- (setq addcr nil))
- (insert v "="))
+ (if (re-search-backward (concat "^" v "\\s-*=") nil t)
+ (progn
+ (ede-pmake-end-of-variable)
+ (if (< (current-column) 40)
+ (if (and (/= (preceding-char) ?=)
+ (/= (preceding-char) ? ))
+ (insert " "))
+ (insert "\\\n "))
+ (setq addcr nil))
+ (insert v "="))
+ ,@body
+ (if addcr (insert "\n"))
+ (goto-char (point-max))))
+(put 'ede-pmake-insert-variable-shared 'lisp-indent-function 1)
+
+(defmacro ede-pmake-insert-variable-once (varname &rest body)
+ "Add VARNAME into the current Makefile if it doesn't exist.
+Execute BODY in a location where a value can be placed."
+ `(let ((addcr t) (v ,varname))
+ (unless (re-search-backward (concat "^" v "\\s-*=") nil t)
+ (insert v "=")
,@body
(if addcr (insert "\n"))
- (goto-char (point-max))))
-(put 'ede-pmake-insert-variable-shared 'lisp-indent-function 1)
+ (goto-char (point-max)))
+ ))
+(put 'ede-pmake-insert-variable-once 'lisp-indent-function 1)
;;; SOURCE VARIABLE NAME CONSTRUCTION
diff --git a/lisp/cedet/ede/proj-comp.el b/lisp/cedet/ede/proj-comp.el
index 2bda2dd106e..be91c25d5f0 100644
--- a/lisp/cedet/ede/proj-comp.el
+++ b/lisp/cedet/ede/proj-comp.el
@@ -46,6 +46,7 @@
(require 'ede) ;source object
(require 'ede/autoconf-edit)
+(eval-when-compile (require 'ede/pmake))
;;; Types:
(defclass ede-compilation-program (eieio-instance-inheritor)
@@ -256,12 +257,11 @@ This will prevent rules from creating duplicate variables or rules."
(with-slots (variables) this
(mapcar
(lambda (var)
- (insert (car var) "=")
- (let ((cd (cdr var)))
- (if (listp cd)
- (mapc (lambda (c) (insert " " c)) cd)
- (insert cd)))
- (insert "\n"))
+ (ede-pmake-insert-variable-once (car var)
+ (let ((cd (cdr var)))
+ (if (listp cd)
+ (mapc (lambda (c) (insert " " c)) cd)
+ (insert cd)))))
variables))))
(defmethod ede-compiler-intermediate-objects-p ((this ede-compiler))
diff --git a/lisp/cedet/ede/srecode.el b/lisp/cedet/ede/srecode.el
index 5f64ed3c7d0..0870517a46e 100644
--- a/lisp/cedet/ede/srecode.el
+++ b/lisp/cedet/ede/srecode.el
@@ -37,27 +37,13 @@
;;; Code:
(defun ede-srecode-setup ()
- "Update various paths to get SRecode to identify our macros."
- (let* ((lib (locate-library "ede.el" t))
- (ededir (file-name-directory lib))
- (tmpdir (file-name-as-directory
- (expand-file-name "templates" ededir))))
- (when (not tmpdir)
- (error "Unable to location EDE Templates directory"))
-
- ;; Rig up the map.
- (require 'srecode/map)
- (require 'srecode/find)
- (add-to-list 'srecode-map-load-path tmpdir)
- (srecode-map-update-map t)
-
- ;; We don't call this unless we need it. Load in the templates.
- (srecode-load-tables-for-mode 'makefile-mode)
- (srecode-load-tables-for-mode 'makefile-mode 'ede)
-
- ;; @todo - autoconf files.
-
- ))
+ "Initialize Srecode for EDE."
+ (require 'srecode/map)
+ (require 'srecode/find)
+ (srecode-map-update-map t)
+ ;; We don't call this unless we need it. Load in the templates.
+ (srecode-load-tables-for-mode 'makefile-mode)
+ (srecode-load-tables-for-mode 'makefile-mode 'ede))
(defmacro ede-srecode-insert-with-dictionary (template &rest forms)
"Insert TEMPLATE after executing FORMS with a dictionary.