;;; ede/proj.el --- EDE Generic Project file driver
-;; Copyright (C) 1998-2003, 2007-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2003, 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: project, make
(autoload 'ede-proj-target-makefile-info "ede/proj-info"
"Target class for info files." nil nil)
+(eieio-defclass-autoload 'ede-proj-target-aux '(ede-proj-target)
+ "ede/proj-aux"
+ "Target class for a group of lisp files.")
+(eieio-defclass-autoload 'ede-proj-target-elisp '(ede-proj-target-makefile)
+ "ede/proj-elisp"
+ "Target class for a group of lisp files.")
+(eieio-defclass-autoload 'ede-proj-target-elisp-autoloads '(ede-proj-target-elisp)
+ "ede/proj-elisp"
+ "Target class for generating autoload files.")
+(eieio-defclass-autoload 'ede-proj-target-scheme '(ede-proj-target)
+ "ede/proj-scheme"
+ "Target class for a group of lisp files.")
+(eieio-defclass-autoload 'ede-proj-target-makefile-miscelaneous '(ede-proj-target-makefile)
+ "ede/proj-misc"
+ "Target class for a group of miscellaneous w/ a special makefile.")
+(eieio-defclass-autoload 'ede-proj-target-makefile-program '(ede-proj-target-makefile-objectcode)
+ "ede/proj-prog"
+ "Target class for building a program.")
+(eieio-defclass-autoload 'ede-proj-target-makefile-archive '(ede-proj-target-makefile-objectcode)
+ "ede/proj-archive"
+ "Target class for building an archive of object code.")
+(eieio-defclass-autoload 'ede-proj-target-makefile-shared-object '(ede-proj-target-makefile-program)
+ "ede/proj-shared"
+ "Target class for building a shared object.")
+(eieio-defclass-autoload 'ede-proj-target-makefile-info '(ede-proj-target-makefile)
+ "ede/proj-info"
+ "Target class for info files.")
+
+;; Not in ede/ , but part of semantic.
+(eieio-defclass-autoload 'semantic-ede-proj-target-grammar '(ede-proj-target-elisp)
+ "semantic/ede-grammar"
+ "Target classfor Semantic grammar files.")
+
;;; Class Definitions:
(defclass ede-proj-target (ede-target)
((auxsource :initarg :auxsource
:initform nil
:type (or null symbol)
:custom (choice (const :tag "None" nil)
+ (symbol :tag "Custom Compiler Symbol")
:slotofchoices availablecompilers)
:label "Compiler for building sources"
:group make
:initform nil
:type (or null symbol)
:custom (choice (const :tag "None" nil)
+ (symbol :tag "Custom Linker Symbol")
:slotofchoices availablelinkers)
:label "Linker for combining intermediate object files."
:group make
(setq ede-proj-target-alist
(cons (cons name class) ede-proj-target-alist)))))
-(defclass ede-proj-project (ede-project)
- ((makefile-type :initarg :makefile-type
+(defclass ede-proj-project (eieio-persistent ede-project)
+ ((extension :initform ".ede")
+ (file-header-line :initform ";; EDE Project Files are auto generated: Do Not Edit")
+ (makefile-type :initarg :makefile-type
:initform Makefile
:type symbol
:custom (choice (const Makefile)
for the tree being read in. If ROOTPROJ is nil, then assume that
the PROJECT being read in is the root project."
(save-excursion
- (let ((ret nil)
+ (let ((ret (eieio-persistent-read (concat project "Project.ede")
+ ede-proj-project))
(subdirs (directory-files project nil "[^.].*" nil)))
- (set-buffer (get-buffer-create " *tmp proj read*"))
- (unwind-protect
- (progn
- (insert-file-contents (concat project "Project.ede")
- nil nil nil t)
- (goto-char (point-min))
- (setq ret (read (current-buffer)))
- (if (not (eq (car ret) 'ede-proj-project))
- (error "Corrupt project file"))
- (setq ret (eval ret))
- (oset ret file (concat project "Project.ede"))
- (oset ret directory project)
- (oset ret rootproject rootproj)
- )
- (kill-buffer " *tmp proj read*"))
+ (if (not (object-of-class-p ret 'ede-proj-project))
+ (error "Corrupt project file"))
+ (oset ret directory project)
+ (oset ret rootproject rootproj)
+
+ ;; Load the project file of each subdirectory containing a
+ ;; loadable Project.ede.
(while subdirs
(let ((sd (file-name-as-directory
(expand-file-name (car subdirs) project))))
(if (and (file-directory-p sd)
- (ede-directory-project-p sd))
+ (file-exists-p (expand-file-name "Project.ede" sd)))
(oset ret subproj
(cons (ede-proj-load sd (or rootproj ret))
(oref ret subproj))))
"Write out object PROJECT into its file."
(save-excursion
(if (not project) (setq project (ede-current-project)))
- (let ((b (set-buffer (get-buffer-create " *tmp proj write*")))
- (cfn (oref project file))
- (cdir (oref project directory)))
+ (let ((cdir (oref project directory)))
(unwind-protect
- (save-excursion
- (erase-buffer)
- (let ((standard-output (current-buffer)))
- (oset project file (file-name-nondirectory cfn))
- (slot-makeunbound project :directory)
- (object-write project ";; EDE project file."))
- (write-file cfn nil)
- )
- ;; Restore the :file on exit.
- (oset project file cfn)
- (oset project directory cdir)
- (kill-buffer b)))))
+ (progn
+ (slot-makeunbound project :directory)
+ (eieio-persistent-save project))
+ ;; Restore the directory slot
+ (oset project directory cdir))) ))
(defmethod ede-commit-local-variables ((proj ede-proj-project))
"Commit change to local variables in PROJ."
(defmethod project-debug-target ((obj ede-proj-target))
"Run the current project target OBJ in a debugger."
- (error "Debug-target not supported by %s" (object-name obj)))
+ (error "Debug-target not supported by %s" (eieio-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)))
+ (error "Run-target not supported by %s" (eieio-object-name obj)))
(defmethod ede-proj-makefile-target-name ((this ede-proj-target))
"Return the name of the main target for THIS target."
(defmethod ede-proj-setup-buildenvironment ((this ede-proj-project)
&optional force)
"Setup the build environment for project THIS.
-Handles the Makefile, or a Makefile.am configure.in combination.
+Handles the Makefile, or a Makefile.am configure.ac combination.
Optional argument FORCE will force items to be regenerated."
(if (not force)
(ede-proj-makefile-create-maybe this (ede-proj-dist-makefile this))
"Rescan the EDE proj project THIS."
(let ((root (or (ede-project-root this) this))
)
- (setq ede-projects (delq root ede-projects))
+ ;; @TODO - VERIFY THE BELOW WORKS
+ (ede-project-directory-remove-hash
+ (file-name-directory (ede-project-root-directory root)))
+ (ede-delete-project-from-global-list root)
+ ;; NOTE : parent function double-checks that this dir was
+ ;; already in memory once.
(ede-load-project-file (ede-project-root-directory root))
))