1 # +----------------------------------------------------------------------+
3 # +----------------------------------------------------------------------+
4 # | Copyright (c) 2000-2006 The PHP Group |
5 # +----------------------------------------------------------------------+
6 # | This source file is subject to version 3.01 of the PHP license, |
7 # | that is bundled with this package in the file LICENSE, and is |
8 # | available through the world-wide-web at the following url: |
9 # | http://www.php.net/license/3_01.txt |
10 # | If you did not receive a copy of the PHP license and are unable to |
11 # | obtain it through the world-wide-web, please send a note to |
12 # | license@php.net so we can mail you a copy immediately. |
13 # +----------------------------------------------------------------------+
14 # | Author: Sascha Schumann <sascha@schumann.cx> |
15 # +----------------------------------------------------------------------+
17 # $Id: mkdep.awk,v 1.8.2.1 2006/01/01 12:50:00 sniper Exp $
21 # echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \
22 # awk -f mkdep.awk > dependencies
31 for (i =
5; i
<=
NF; i
++) {
32 if (match($i
, "^-[A-Z]") ==
0)
44 for(i =
1; i
<= no_files
; i
++) {
45 if (system("test -r " filenames
[i
]) != 0)
49 sub(srcdir
"/", "", target
)
51 sub("\.(c|cpp)$", ".lo", target
);
52 sub("\.(c|cpp)$", ".slo", target2
);
57 cmdx=cmd
" " filenames
[i
]
59 while ((cmdx
| getline) > 0) {
60 if (match($
0, "^# [0-9]* \".*\.h\"") != 0) {
61 if (sub(top_srcdir
, "$(top_srcdir)", $
3) ==
0)
62 sub(top_builddir
, "$(top_builddir)", $
3)
63 if (substr($
3,2,1) != "/" && used
[$
3] != 1) {
65 printf(target
" " target2
":")
67 printf(" \\\n\t" substr($
3,2,length($
3)-2))