1 ;;; ede-proj-prog.el --- EDE Generic Project program support
3 ;;; Copyright (C) 1998, 1999, 2000, 2001, 2005 Eric M. Ludlam
5 ;; Author: Eric M. Ludlam <zappo@gnu.org>
6 ;; Keywords: project, make
7 ;; RCS: $Id: ede-proj-prog.el,v 1.1 2007-11-26 15:22:09 michaels Exp $
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)
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.
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.
26 ;; Handle building programs from object files in and EDE Project file.
29 (require 'ede-proj-obj)
32 (defclass ede-proj-target-makefile-program
33 (ede-proj-target-makefile-objectcode)
34 ((ldlibs :initarg :ldlibs
37 :custom (repeat (string :tag "Library"))
39 "Libraries, such as \"m\" or \"Xt\" which this program dependso on.
40 The linker flag \"-l\" is automatically prepended. Do not include a \"lib\"
41 prefix, or a \".so\" suffix.
43 Note: Currently only used for Automake projects."
45 (ldflags :initarg :ldflags
48 :custom (repeat (string :tag "Link Flag"))
50 "Additional flags to add when linking this target.
51 Use ldlibs to add addition libraries. Use this to specify specific
52 options to the linker.
54 Note: Not currently used. This bug needs to be fixed.")
56 "This target is an executable program.")
58 (defmethod ede-proj-makefile-insert-automake-pre-variables
59 ((this ede-proj-target-makefile-program))
60 "Insert bin_PROGRAMS variables needed by target THIS."
61 (ede-pmake-insert-variable-shared "bin_PROGRAMS"
62 (insert (ede-name this)))
65 (defmethod ede-proj-makefile-insert-automake-post-variables
66 ((this ede-proj-target-makefile-program))
67 "Insert bin_PROGRAMS variables needed by target THIS."
68 (ede-pmake-insert-variable-shared
69 (concat (ede-name this) "_LDADD")
70 (mapcar (lambda (c) (insert " -l" c)) (oref this ldlibs)))
71 ;; For other targets THIS depends on
75 ;;(ede-pmake-insert-variable-shared
76 ;; (concat (ede-name this) "_DEPENDENCIES")
77 ;; (mapcar (lambda (d) (insert d)) (oref this FOOOOOOOO)))
80 (defmethod ede-proj-makefile-insert-rules ((this ede-proj-target-makefile-program))
81 "Insert rules needed by THIS target."
82 (let ((ede-proj-compiler-object-linkflags
83 (mapconcat 'identity (oref this ldflags) " ")))
84 (with-slots (ldlibs) this
86 (setq ede-proj-compiler-object-linkflags
87 (concat ede-proj-compiler-object-linkflags
89 (mapconcat 'identity ldlibs " -l")))))
92 (defmethod project-debug-target ((obj ede-proj-target-makefile-program))
93 "Debug a program target OBJ."
94 (let ((tb (get-buffer-create " *padt*"))
95 (dd (if (not (string= (oref obj path) ""))
102 (setq default-directory dd)
103 (setq cmd (read-from-minibuffer
105 (concat (symbol-name ede-debug-program-function)
106 " " (ede-target-name obj))))
107 (funcall ede-debug-program-function cmd))
111 (provide 'ede-proj-prog)
113 ;;; ede-proj-prog.el ends here