-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmake-depends
106 lines (97 loc) · 2.92 KB
/
make-depends
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
#******************************************************************************
#FILE: make-depends
#LANGUAGE: bash shell script
#SYSTEM: POSIX
#USER-INTERFACE: POSIX
#DESCRIPTION
#
# This scripts run pjb-make-depends elisp script to create a Makefile.depend
#
#USAGE
#
# make-depends [ -Iinclude-dir | lisp-object-file ] ...
#
#AUTHORS
# <PJB> Pascal J. Bourguignon <[email protected]>
#MODIFICATIONS
# 2002-12-04 <PJB> Created.
#BUGS
#LEGAL
# Copyright Pascal J. Bourguignon 2002 - 2002
#
# This script is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this library; see the file COPYING.LIB.
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#******************************************************************************
pname="$(basename $0)"
pblan="${pname//?/ }"
function usage () {
echo "${pname} usage:"
echo " ${pname} [-Iinclude-dir|lisp-object-file]... "
}
DIR="$(dirname $0)"
IDIRES=""
OFILES=""
trace=0
closure=0
for arg ; do
case "$arg" in
-h|--help)
usage
exit 0
;;
-I*)
IDIRES="$IDIRES \"${arg/-I}\""
;;
-t)
trace=1
;;
-c)
closure=1
;;
-*)
echo "${pname}: Invalid option '$arg'."
usage
exit 1
;;
*)
OFILES="$OFILES \"$arg\""
;;
esac
done
if [ $closure -ne 0 ] ; then
emacs -q -nw --batch -l .emacs --eval "
(progn
(setq debugger (lambda (x y) (message \"### Error: %S %S\\n\" x y)
(backtrace) (kill-emacs)) debug-on-error t)
(add-to-list 'load-path \"$DIR\")
(load \"pjb-cl.el\")
(load \"pjb-list.el\")
(load \"pjb-make-depends.el\")
(mapc (lambda (item) (princ item) (princ \" \"))
(nreverse (list-to-set (nreverse
(get-closed-dependencies $OFILES '( $IDIRES )))))) ) "
else
emacs -q -nw --batch -l .emacs --eval "
(progn
;; (setq debugger (lambda (x y) (message \"### Error: %S %S\\n\" x y)
;; (backtrace) (kill-emacs)) debug-on-error t)
(add-to-list 'load-path \"$DIR\")
(load \"pjb-cl.el\")
(load \"pjb-make-depends.el\")
(make-depends '( $OFILES ) '( $IDIRES )) )"
fi | grep -v Loading
#END#
#### make-depends -- 2004-01-10 21:42:18 -- pascal ####