Skip to content

Commit 71141bb

Browse files
* mkdep: New file.
* Makefile.in (GAS_SUPPORT_DIRS): Add mkdep. (BINUTILS_SUPPORT_DIRS): Add mkdep.
1 parent f4162f5 commit 71141bb

File tree

3 files changed

+93
-2
lines changed

3 files changed

+93
-2
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
1999-08-08 Ian Lance Taylor <[email protected]>
22

3+
* mkdep: New file.
4+
* Makefile.in (GAS_SUPPORT_DIRS): Add mkdep.
5+
(BINUTILS_SUPPORT_DIRS): Add mkdep.
6+
37
From Eli Zaretskii <[email protected]>:
48
* configure (tmpfile): Change cONf$$ to cNf$$ to avoid an overly
59
long file name when using DJGPP on MS-DOS.

Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,14 +1758,14 @@ TEXINFO_SUPPORT= texinfo/texinfo.tex
17581758
DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
17591759
17601760
.PHONY: gas.tar.bz2
1761-
GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms
1761+
GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
17621762
gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
17631763
$(MAKE) -f Makefile.in taz TOOL=gas \
17641764
SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
17651765
17661766
# The FSF "binutils" release includes gprof and ld.
17671767
.PHONY: binutils.tar.bz2
1768-
BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms
1768+
BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
17691769
binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
17701770
$(MAKE) -f Makefile.in taz TOOL=binutils \
17711771
SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"

mkdep

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/bin/sh -
2+
#
3+
# Copyright (c) 1987 Regents of the University of California.
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms are permitted
7+
# provided that the above copyright notice and this paragraph are
8+
# duplicated in all such forms and that any documentation,
9+
# advertising materials, and other materials related to such
10+
# distribution and use acknowledge that the software was developed
11+
# by the University of California, Berkeley. The name of the
12+
# University may not be used to endorse or promote products derived
13+
# from this software without specific prior written permission.
14+
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15+
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16+
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17+
#
18+
# @(#)mkdep.sh 5.12 (Berkeley) 6/30/88
19+
#
20+
21+
MAKE=Makefile # default makefile name is "Makefile"
22+
23+
while :
24+
do case "$1" in
25+
# -f allows you to select a makefile name
26+
-f)
27+
MAKE=$2
28+
shift; shift ;;
29+
30+
# the -p flag produces "program: program.c" style dependencies
31+
# so .o's don't get produced
32+
-p)
33+
SED='s;\.o;;'
34+
shift ;;
35+
*)
36+
break ;;
37+
esac
38+
done
39+
40+
if [ $# = 0 ] ; then
41+
echo 'usage: mkdep [-p] [-f makefile] [flags] file ...'
42+
exit 1
43+
fi
44+
45+
if [ ! -w $MAKE ]; then
46+
echo "mkdep: no writeable file \"$MAKE\""
47+
exit 1
48+
fi
49+
50+
TMP=/tmp/mkdep$$
51+
52+
trap 'rm -f $TMP ; exit 1' 1 2 3 13 15
53+
54+
cp $MAKE ${MAKE}.bak
55+
56+
sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP
57+
58+
cat << _EOF_ >> $TMP
59+
# DO NOT DELETE THIS LINE -- mkdep uses it.
60+
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
61+
62+
_EOF_
63+
64+
# If your compiler doesn't have -M, add it. If you can't, the next two
65+
# lines will try and replace the "cc -M". The real problem is that this
66+
# hack can't deal with anything that requires a search path, and doesn't
67+
# even try for anything using bracket (<>) syntax.
68+
#
69+
# egrep '^#include[ ]*".*"' /dev/null $* |
70+
# sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' |
71+
72+
gcc -MM $* |
73+
sed "
74+
s; \./; ;g
75+
$SED" >> $TMP
76+
77+
cat << _EOF_ >> $TMP
78+
79+
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
80+
_EOF_
81+
82+
# copy to preserve permissions
83+
cp $TMP $MAKE
84+
rm -f ${MAKE}.bak $TMP
85+
exit 0
86+
87+

0 commit comments

Comments
 (0)