Initial Commit
[packages] / xemacs-packages / ede / ede-proj-misc.el
1 ;;; ede-proj-nusc.el --- EDE Generic Project Emacs Lisp support
2
3 ;;;  Copyright (C) 1998, 1999, 2000, 2001  Eric M. Ludlam
4
5 ;; Author: Eric M. Ludlam <zappo@gnu.org>
6 ;; Keywords: project, make
7 ;; RCS: $Id: ede-proj-misc.el,v 1.1 2007-11-26 15:22:09 michaels Exp $
8
9 ;; This software is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; any later version.
13
14 ;; This software is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ;; GNU General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
21 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
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                 "Miscelaneous 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