1 ;;; ede-proj-misc.el --- EDE Generic Project Emacs Lisp support
3 ;; Copyright (C) 1998-2001, 2008-2017 Free Software Foundation, Inc.
5 ;; Author: Eric M. Ludlam <zappo@gnu.org>
6 ;; Keywords: project, make
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;; Handle miscellaneous compilable projects in and EDE Project file.
26 ;; This misc target lets the user link in custom makefiles to an EDE
29 (eval-when-compile (require 'cl
))
31 (require 'ede
/proj-comp
)
35 ;; FIXME this isn't how you spell "miscellaneous". :(
36 (defclass ede-proj-target-makefile-miscelaneous
(ede-proj-target-makefile)
37 ((sourcetype :initform
'(ede-misc-source))
38 (availablecompilers :initform
'(ede-misc-compile))
39 (submakefile :initarg
:submakefile
44 "Miscellaneous sources which have a specialized makefile.
45 The sub-makefile is used to build this target.")
47 "Miscellaneous target type.
48 A user-written makefile is used to build this target.
49 All listed sources are included in the distribution.")
51 (defvar ede-misc-source
52 (ede-sourcecode "ede-misc-source"
55 "Miscellaneous field definition.")
57 (defvar ede-misc-compile
58 (ede-compiler "ede-misc-compile"
64 :sourcetype
'(ede-misc-source)
66 "Compile code via a sub-makefile.")
68 (cl-defmethod ede-proj-makefile-sourcevar ((this ede-proj-target-makefile-miscelaneous
))
69 "Return the variable name for THIS's sources."
70 (concat (ede-pmake-varname this
) "_MISC"))
72 (cl-defmethod ede-proj-makefile-dependency-files
73 ((this ede-proj-target-makefile-miscelaneous
))
74 "Return a list of files which THIS target depends on."
75 (with-slots (submakefile) this
76 (cond ((string= submakefile
"")
80 (t (list submakefile
)))))
82 (cl-defmethod ede-proj-makefile-insert-rules ((this ede-proj-target-makefile-miscelaneous
))
83 "Create the make rule needed to create an archive for THIS."
84 ;; DO NOT call the next method. We will never have any compilers,
85 ;; or any dependencies, or stuff like this. This rule will let us
86 ;; deal with it in a nice way.
87 (insert (ede-name this
) ": ")
88 (with-slots (submakefile) this
89 (if (string= submakefile
"")
91 (insert submakefile
"\n" "\t$(MAKE) -f " submakefile
"\n\n"))))
93 (provide 'ede
/proj-misc
)
95 ;;; ede/proj-misc.el ends here