summaryrefslogtreecommitdiff
path: root/mcon/U/mkdep.U
diff options
context:
space:
mode:
Diffstat (limited to 'mcon/U/mkdep.U')
-rw-r--r--mcon/U/mkdep.U33
1 files changed, 25 insertions, 8 deletions
diff --git a/mcon/U/mkdep.U b/mcon/U/mkdep.U
index 52d49c6..23d1a26 100644
--- a/mcon/U/mkdep.U
+++ b/mcon/U/mkdep.U
@@ -1,12 +1,12 @@
-?RCS: $Id: mkdep.U,v 3.0.1.4 1997/02/28 16:13:07 ram Exp $
+?RCS: $Id$
?RCS:
-?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
?RCS: You may redistribute only under the terms of the Artistic Licence,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic Licence; a copy of which may be found at the root
-?RCS: of the source tree for dist 3.0.
+?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: mkdep.U,v $
?RCS: Revision 3.0.1.4 1997/02/28 16:13:07 ram
@@ -30,7 +30,7 @@
?X: generation (usage: 'mkdep [cppflags] -- *.c').
?X:
?MAKE:mkdep: spitshell startsh cpp +cppflags grep contains rm sed sort uniq \
- Getfile Oldconfig eunicefix cat +cc cppminus test _o
+ Getfile Oldconfig eunicefix cat +cc cppminus test pkgsrc _o
?MAKE: -pick add $@ %<
?S:mkdep:
?S: This variable holds the name of a command to generate makefile
@@ -67,11 +67,27 @@ case "$mkdep" in
'')
;;
*)
- if test -x "$mkdep" &&
+ if test -f "$mkdep" &&
$mkdep dep.c >dep.out 2>/dev/null &&
$contains "dep$_o:.*dep\.h" dep.out >/dev/null 2>&1
then
echo "$mkdep works."
+?X: If they copied a config.sh from some other place, they'll have a working
+?X: mkdep script probably, but not located at the top of the sources. And
+?X: the Makefiles generated by jmake expect an mkdep script in the top dir.
+ case "$mkdep" in
+ "$pkgsrc/mkdep");;
+ *) echo "(copying it to $pkgsrc)"
+ cp $mkdep $pkgsrc/mkdep 2>/dev/null
+ if $pkgsrc/mkdep dep.c >dep.out 2>/dev/null &&
+ $contains "dep$_o:.*dep\.h" dep.out >/dev/null 2>&1; then
+ mkdep=$pkgsrc/mkdep
+ else
+ echo "Hmm... The copy failed or something... Guessing again..."
+ mkdep=
+ fi
+ ;;
+ esac
else
mkdep=
fi
@@ -86,7 +102,7 @@ $startsh
$takeflags
for srcfile
do
- $cpp -M -I. $cppflags \$flags \$srcfile 2>/dev/null
+ $cpp -M $cppflags \$flags \$srcfile 2>/dev/null
done
exit 0
EOM
@@ -112,7 +128,7 @@ $startsh
$takeflags
for srcfile
do
- $cc -MM -I. $cppflags \$flags \$srcfile 2>/dev/null
+ $cc -MM $cppflags \$flags \$srcfile 2>/dev/null
done
exit 0
EOM
@@ -143,7 +159,7 @@ do
*.l) c='.l';;
esac
filebase=\`basename \$srcfile \$c\`
- <\$srcfile $cpp $cppminus $cppflags -I. \$flags 2>/dev/null | \\
+ <\$srcfile $cpp $cppminus $cppflags \$flags 2>/dev/null | \\
$sed -e '/^# *[0-9]/!d' \\
-e 's/^.*"\(.*\)".*\$/'\$filebase'$_o: \1/' \\
-e 's|: \./|: |' \\
@@ -242,6 +258,7 @@ EOM
fi
fi
esac
+echo " "
dflt="$mkdep"
fn=f~/
rp="Name of program to make makefile dependencies?"