Deleted Added
full compact
mkdep.gcc.sh (2178) mkdep.gcc.sh (2406)
1#!/bin/sh -
2#
3# Copyright (c) 1991, 1993
4# The Regents of the University of California. All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 58 unchanged lines hidden (view full) ---

67 echo 'usage: mkdep [-p] [-f depend_file] [cc_flags] file ...'
68 exit 1
69fi
70
71TMP=/tmp/mkdep$$
72
73trap 'rm -f $TMP ; exit 1' 1 2 3 13 15
74
1#!/bin/sh -
2#
3# Copyright (c) 1991, 1993
4# The Regents of the University of California. All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 58 unchanged lines hidden (view full) ---

67 echo 'usage: mkdep [-p] [-f depend_file] [cc_flags] file ...'
68 exit 1
69fi
70
71TMP=/tmp/mkdep$$
72
73trap 'rm -f $TMP ; exit 1' 1 2 3 13 15
74
75# For C sources, mkdep must use exactly the same cpp and predefined flags
76# as the compiler would. This is easily arranged by letting the compiler
77# pick the cpp. mkdep must be told the cpp to use for exceptional cases.
78MKDEP_CPP=${MKDEP_CPP-"cc -E"}
79
75if [ x$pflag = x ]; then
80if [ x$pflag = x ]; then
76 cpp -M $* | sed -e 's; \./; ;g' > $TMP
81 $MKDEP_CPP -M $* | sed -e 's; \./; ;g' > $TMP
77else
82else
78 cpp -M $* | sed -e 's;\.o :; :;' -e 's; \./; ;g' > $TMP
83 $MKDEP_CPP -M $* | sed -e 's;\.o :; :;' -e 's; \./; ;g' > $TMP
79fi
80
81if [ $? != 0 ]; then
82 echo 'mkdep: compile failed.'
83 rm -f $TMP
84 exit 1
85fi
86
87if [ $append = 1 ]; then
88 cat $TMP >> $D
89 rm -f $TMP
90else
91 mv $TMP $D
92fi
93exit 0
84fi
85
86if [ $? != 0 ]; then
87 echo 'mkdep: compile failed.'
88 rm -f $TMP
89 exit 1
90fi
91
92if [ $append = 1 ]; then
93 cat $TMP >> $D
94 rm -f $TMP
95else
96 mv $TMP $D
97fi
98exit 0