Add 2009 to copyright years.
[bpt/emacs.git] / lisp / cedet / ede / proj-misc.el
1 ;;; ede-proj-nusc.el --- EDE Generic Project Emacs Lisp support
2
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2008, 2009
4 ;; Free Software Foundation, Inc.
5
6 ;; Author: Eric M. Ludlam <zappo@gnu.org>
7 ;; Keywords: project, make
8
9 ;; This file is part of GNU Emacs.
10
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
15
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24 ;;; Commentary:
25 ;;
26 ;; Handle miscelaneous compilable projects in and EDE Project file.
27 ;; This misc target lets the user link in custom makefiles to an EDE
28 ;; project.
29
30 (require 'ede/pmake)
31 (require 'ede/proj-comp)
32
33 ;;; Code:
34 (defclass ede-proj-target-makefile-miscelaneous (ede-proj-target-makefile)
35 ((sourcetype :initform (ede-misc-source))
36 (availablecompilers :initform (ede-misc-compile))
37 (submakefile :initarg :submakefile
38 :initform ""
39 :type string
40 :custom string
41 :documentation
42 "Miscellaneous sources which have a specialized makefile.
43 The sub-makefile is used to build this target.")
44 )
45 "Miscelaneous target type.
46 A user-written makefile is used to build this target.
47 All listed sources are included in the distribution.")
48
49 (defvar ede-misc-source
50 (ede-sourcecode "ede-misc-source"
51 :name "Miscelaneous"
52 :sourcepattern ".*")
53 "Miscelaneous fiels definition.")
54
55 (defvar ede-misc-compile
56 (ede-compiler "ede-misc-compile"
57 :name "Sub Makefile"
58 :commands
59 '(
60 )
61 :autoconf nil
62 :sourcetype '(ede-misc-source)
63 )
64 "Compile code via a sub-makefile.")
65
66 (defmethod ede-proj-makefile-sourcevar ((this ede-proj-target-makefile-miscelaneous))
67 "Return the variable name for THIS's sources."
68 (concat (ede-pmake-varname this) "_MISC"))
69
70 (defmethod ede-proj-makefile-dependency-files
71 ((this ede-proj-target-makefile-miscelaneous))
72 "Return a list of files which THIS target depends on."
73 (with-slots (submakefile) this
74 (cond ((string= submakefile "")
75 nil)
76 ((not submakefile)
77 nil)
78 (t (list submakefile)))))
79
80 (defmethod ede-proj-makefile-insert-rules ((this ede-proj-target-makefile-miscelaneous))
81 "Create the make rule needed to create an archive for THIS."
82 ;; DO NOT call the next method. We will never have any compilers,
83 ;; or any dependencies, or stuff like this. This rull will lets us
84 ;; deal with it in a nice way.
85 (insert (ede-name this) ": ")
86 (with-slots (submakefile) this
87 (if (string= submakefile "")
88 (insert "\n\t@\n\n")
89 (insert submakefile "\n" "\t$(MAKE) -f " submakefile "\n\n"))))
90
91 (provide 'ede/proj-misc)
92
93 ;;; ede/proj-misc.el ends here