Commit | Line | Data |
---|---|---|
acc33231 CY |
1 | ;;; ede/proj-archive.el --- EDE Generic Project archive support |
2 | ||
acaf905b | 3 | ;; Copyright (C) 1998-2001, 2009-2012 Free Software Foundation, Inc. |
acc33231 CY |
4 | |
5 | ;; Author: Eric M. Ludlam <zappo@gnu.org> | |
6 | ;; Keywords: project, make | |
7 | ||
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. | |
12 | ||
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. | |
17 | ||
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/>. | |
20 | ||
21 | ;;; Commentary: | |
22 | ;; | |
23 | ;; Handle object code archives in and EDE Project file. | |
24 | ||
25 | (require 'ede/pmake) | |
26 | (require 'ede/proj-obj) | |
27 | ||
28 | ;;; Code: | |
29 | ||
30 | (defclass ede-proj-target-makefile-archive | |
31 | (ede-proj-target-makefile-objectcode) | |
cb85c0d8 | 32 | ((availablelinkers :initform '(ede-archive-linker))) |
acc33231 CY |
33 | "This target generates an object code archive.") |
34 | ||
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.") | |
45 | ||
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. | |
a87ef899 | 49 | We aren't actually inserting SOURCE details, but this is used by the |
acc33231 CY |
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")))) | |
54 | ||
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"))))) | |
61 | ||
62 | (provide 'ede/proj-archive) | |
63 | ||
64 | ;;; ede/proj-archive.el ends here |