;;; ede/proj.el --- EDE Generic Project file driver
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2009
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1998-2003, 2007-2011 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: project, make
;; rebuild. The targets provided in ede-proj can be augmented with
;; additional target types inherited directly from `ede-proj-target'.
-;; (eval-and-compile '(require 'ede))
(require 'ede/proj-comp)
(require 'ede/make)
(or (string= (file-name-nondirectory (oref this file)) f)
(string= (ede-proj-dist-makefile this) f)
(string-match "Makefile\\(\\.\\(in\\|am\\)\\)?$" f)
- (string-match "config\\(ure\\.in\\|\\.stutus\\)?$" f)
+ (string-match "config\\(ure\\.\\(in\\|ac\\)\\|\\.status\\)?$" f)
+ (string-match "config.h\\(\\.in\\)?" f)
+ (member f '("AUTHORS" "NEWS" "COPYING" "INSTALL" "README"))
)))
(defmethod ede-buffer-mine ((this ede-proj-target) buffer)
:source nil)))
(defmethod project-delete-target ((this ede-proj-target))
- "Delete the current target THIS from it's parent project."
+ "Delete the current target THIS from its parent project."
(let ((p (ede-current-project))
(ts (oref this source)))
;; Loop across all sources. If it exists in a buffer,
- ;; clear it's object.
+ ;; clear its object.
(while ts
(let* ((default-directory (oref this path))
(b (get-file-buffer (car ts))))
(if b
- (save-excursion
- (set-buffer b)
+ (with-current-buffer b
(if (eq ede-object this)
(progn
(setq ede-object nil)
(ede-apply-object-keymap))))))
(setq ts (cdr ts)))
- ;; Remove THIS from it's parent.
+ ;; Remove THIS from its parent.
;; The two vectors should be pointer equivalent.
(oset p targets (delq this (oref p targets)))
(ede-proj-save (ede-current-project))))
(defmethod project-make-dist ((this ede-proj-project))
"Build a distribution for the project based on THIS target."
- ;; I'm a lazy bum, so I'll make a makefile for doing this sort
- ;; of thing, and rely only on that small section of code.
(let ((pm (ede-proj-dist-makefile this))
(df (project-dist-files this)))
(if (and (file-exists-p (car df))
(not (y-or-n-p "Dist file already exists. Rebuild? ")))
(error "Try `ede-update-version' before making a distribution"))
(ede-proj-setup-buildenvironment this)
- (if (string= pm "Makefile.am") (setq pm "Makefile"))
- (compile (concat ede-make-command " -f " pm " dist"))
- ))
+ (if (ede-proj-automake-p this)
+ (setq pm (expand-file-name "Makefile"
+ (file-name-directory pm))))
+ (compile (concat ede-make-command " -f " pm " dist"))))
(defmethod project-dist-files ((this ede-proj-project))
"Return a list of files that constitutes a distribution of THIS project."
(let ((pm (ede-proj-dist-makefile proj))
(default-directory (file-name-directory (oref proj file))))
(ede-proj-setup-buildenvironment proj)
- (if (string= pm "Makefile.am") (setq pm "Makefile"))
+ (if (ede-proj-automake-p proj)
+ (setq pm (expand-file-name "Makefile"
+ (file-name-directory pm))))
(compile (concat ede-make-command" -f " pm " all"))))
;;; Target type specific compilations/debug
"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))
(if (ede-want-any-source-files-p (symbol-value (car st)) sources)
(let ((c (ede-proj-find-compiler avail (car st))))
(if c (setq comp (cons c comp)))))
- (setq st (cdr st)))))
+ (setq st (cdr st)))
+ ;; Provide a good error msg.
+ (unless comp
+ (error "Could not find compiler match for source code extension \"%s\".
+You may need to add support for this type of file."
+ (if sources
+ (file-name-extension (car sources))
+ "")))
+ ))
;; Return the disovered compilers
comp)))
(concat (file-name-directory (oref this file))
"Makefile.am"))
((eq (oref this makefile-type) 'Makefile.in)
- (concat (file-name-directory (oref this file))
- "Makefile.in"))
+ (expand-file-name "Makefile.in"
+ (file-name-directory (oref this file))))
((object-assoc "Makefile" 'makefile (oref this targets))
- (concat (file-name-directory (oref this file))
- "Makefile"))
+ (expand-file-name "Makefile"
+ (file-name-directory (oref this file))))
(t
(let ((targets (oref this targets)))
(while (and targets
'ede-proj-target-makefile)))
(setq targets (cdr targets)))
(if targets (oref (car targets) makefile)
- (concat (file-name-directory (oref this file))
- "Makefile"))))))
+ (expand-file-name "Makefile"
+ (file-name-directory (oref this file))))))))
(defun ede-proj-regenerate ()
"Regenerate Makefiles for and edeproject project."
(let ((root (or (ede-project-root this) this))
)
(setq ede-projects (delq root ede-projects))
- (ede-proj-load (ede-project-root-directory root))
+ (ede-load-project-file (ede-project-root-directory root))
))
-(defmethod project-rescan ((this ede-proj-target) readstream)
- "Rescan target THIS from the read list READSTREAM."
- (setq readstream (cdr (cdr readstream))) ;; constructor/name
- (while readstream
- (let ((tag (car readstream))
- (val (car (cdr readstream))))
- (eieio-oset this tag val))
- (setq readstream (cdr (cdr readstream)))))
-
(provide 'ede/proj)
-;; arch-tag: eb8a40f8-0d2c-41c4-b273-af04101d1cdf
;;; ede/proj.el ends here