]> code.delx.au - gnu-emacs/blob - lisp/cedet/ede/proj-misc.el
Add 2012 to FSF copyright years for Emacs files (do not merge to trunk)
[gnu-emacs] / lisp / cedet / ede / proj-misc.el
1 ;;; ede-proj-misc.el --- EDE Generic Project Emacs Lisp support
2
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2008, 2009, 2010, 2011, 2012
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 miscellaneous 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 (eval-when-compile (require 'cl))
31 (require 'ede/pmake)
32 (require 'ede/proj-comp)
33
34 ;;; Code:
35
36 ;; FIXME this isn't how you spell "miscellaneous". :(
37 (defclass ede-proj-target-makefile-miscelaneous (ede-proj-target-makefile)
38 ((sourcetype :initform '(ede-misc-source))
39 (availablecompilers :initform '(ede-misc-compile))
40 (submakefile :initarg :submakefile
41 :initform ""
42 :type string
43 :custom string
44 :documentation
45 "Miscellaneous sources which have a specialized makefile.
46 The sub-makefile is used to build this target.")
47 )
48 "Miscellaneous target type.
49 A user-written makefile is used to build this target.
50 All listed sources are included in the distribution.")
51
52 (defvar ede-misc-source
53 (ede-sourcecode "ede-misc-source"
54 :name "Miscelaneous"
55 :sourcepattern ".*")
56 "Miscellaneous field definition.")
57
58 (defvar ede-misc-compile
59 (ede-compiler "ede-misc-compile"
60 :name "Sub Makefile"
61 :commands
62 '(
63 )
64 :autoconf nil
65 :sourcetype '(ede-misc-source)
66 )
67 "Compile code via a sub-makefile.")
68
69 (defmethod ede-proj-makefile-sourcevar ((this ede-proj-target-makefile-miscelaneous))
70 "Return the variable name for THIS's sources."
71 (concat (ede-pmake-varname this) "_MISC"))
72
73 (defmethod ede-proj-makefile-dependency-files
74 ((this ede-proj-target-makefile-miscelaneous))
75 "Return a list of files which THIS target depends on."
76 (with-slots (submakefile) this
77 (cond ((string= submakefile "")
78 nil)
79 ((not submakefile)
80 nil)
81 (t (list submakefile)))))
82
83 (defmethod ede-proj-makefile-insert-rules ((this ede-proj-target-makefile-miscelaneous))
84 "Create the make rule needed to create an archive for THIS."
85 ;; DO NOT call the next method. We will never have any compilers,
86 ;; or any dependencies, or stuff like this. This rule will let us
87 ;; deal with it in a nice way.
88 (insert (ede-name this) ": ")
89 (with-slots (submakefile) this
90 (if (string= submakefile "")
91 (insert "\n\t@\n\n")
92 (insert submakefile "\n" "\t$(MAKE) -f " submakefile "\n\n"))))
93
94 (provide 'ede/proj-misc)
95
96 ;; arch-tag: e5e5f8d2-9897-4a1b-8a29-5944ec5a892d
97 ;;; ede/proj-misc.el ends here