Add 2012 to FSF copyright years for Emacs files (do not merge to trunk)
[bpt/emacs.git] / lisp / cedet / ede / proj-misc.el
CommitLineData
70018c74 1;;; ede-proj-misc.el --- EDE Generic Project Emacs Lisp support
acc33231 2
49f70d46 3;; Copyright (C) 1998, 1999, 2000, 2001, 2008, 2009, 2010, 2011, 2012
cb758101 4;; Free Software Foundation, Inc.
acc33231
CY
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;;
70018c74 26;; Handle miscellaneous compilable projects in and EDE Project file.
acc33231
CY
27;; This misc target lets the user link in custom makefiles to an EDE
28;; project.
29
67d3ffe4 30(eval-when-compile (require 'cl))
acc33231
CY
31(require 'ede/pmake)
32(require 'ede/proj-comp)
33
34;;; Code:
a1f1d102
GM
35
36;; FIXME this isn't how you spell "miscellaneous". :(
acc33231 37(defclass ede-proj-target-makefile-miscelaneous (ede-proj-target-makefile)
cb85c0d8
EL
38 ((sourcetype :initform '(ede-misc-source))
39 (availablecompilers :initform '(ede-misc-compile))
acc33231
CY
40 (submakefile :initarg :submakefile
41 :initform ""
42 :type string
43 :custom string
44 :documentation
45 "Miscellaneous sources which have a specialized makefile.
46The sub-makefile is used to build this target.")
47 )
a1f1d102 48 "Miscellaneous target type.
acc33231
CY
49A user-written makefile is used to build this target.
50All listed sources are included in the distribution.")
51
52(defvar ede-misc-source
53 (ede-sourcecode "ede-misc-source"
54 :name "Miscelaneous"
55 :sourcepattern ".*")
a1f1d102 56 "Miscellaneous field definition.")
acc33231
CY
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,
a1f1d102 86 ;; or any dependencies, or stuff like this. This rule will let us
acc33231
CY
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
3999968a 96;; arch-tag: e5e5f8d2-9897-4a1b-8a29-5944ec5a892d
acc33231 97;;; ede/proj-misc.el ends here