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