proj-misc.el 3.0 KB

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