proj-archive.el 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ;;; ede/proj-archive.el --- EDE Generic Project archive support
  2. ;; Copyright (C) 1998-2001, 2009-2012 Free Software Foundation, Inc.
  3. ;; Author: Eric M. Ludlam <zappo@gnu.org>
  4. ;; Keywords: project, make
  5. ;; GNU Emacs is free software: you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; GNU Emacs is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Commentary:
  16. ;;
  17. ;; Handle object code archives in and EDE Project file.
  18. (require 'ede/pmake)
  19. (require 'ede/proj-obj)
  20. ;;; Code:
  21. (defclass ede-proj-target-makefile-archive
  22. (ede-proj-target-makefile-objectcode)
  23. ((availablelinkers :initform '(ede-archive-linker)))
  24. "This target generates an object code archive.")
  25. (defvar ede-archive-linker
  26. (ede-linker
  27. "ede-archive-linker"
  28. :name "ar"
  29. :variables '(("AR" . "ar")
  30. ("AR_CMD" . "$(AR) cr"))
  31. :commands '("$(AR_CMD) lib$@.a $^")
  32. :autoconf '(("AC_CHECK_PROGS" . "RANLIB, ranlib"))
  33. :objectextention "")
  34. "Linker object for creating an archive.")
  35. (defmethod ede-proj-makefile-insert-source-variables :BEFORE
  36. ((this ede-proj-target-makefile-archive) &optional moresource)
  37. "Insert bin_PROGRAMS variables needed by target THIS.
  38. We aren't actually inserting SOURCE details, but this is used by the
  39. Makefile.am generator, so use it to add this important bin program."
  40. (ede-pmake-insert-variable-shared
  41. (concat "lib" (ede-name this) "_a_LIBRARIES")
  42. (insert (concat "lib" (ede-name this) ".a"))))
  43. (defmethod ede-proj-makefile-garbage-patterns
  44. ((this ede-proj-target-makefile-archive))
  45. "Add archive name to the garbage patterns.
  46. This makes sure that the archive is removed with 'make clean'."
  47. (let ((garb (call-next-method)))
  48. (append garb (list (concat "lib" (ede-name this) ".a")))))
  49. (provide 'ede/proj-archive)
  50. ;;; ede/proj-archive.el ends here