| | 13 | ;; |
| | 14 | dep*) |
| | 15 | pwd=$(readlink -f "$(pwd)") |
| | 16 | builddir=$(readlink -f ../trunk-php5-debug) |
| | 17 | if [[ -z $builddir ]]; then |
| | 18 | echo required ../trunk-php5-debug not found |
| | 19 | return 1 |
| | 20 | fi |
| | 21 | find . -iname \*.c | while read -r sourceFile; do |
| | 22 | sourceFile=${sourceFile#./} |
| | 23 | echo -n "\$(builddir)/${sourceFile%.c}.lo:" |
| | 24 | for dependency in $(gcc -M $sourceFile -I$HOME/test/php5-debug/include/php/{,main,Zend,TSRM} -I. -I${builddir} -MG | sed 's#.*:##g' | sed 's#\\##g'); do |
| | 25 | dependency=$(readlink -f "$dependency") |
| | 26 | case "$dependency" in |
| | 27 | $pwd/*) |
| | 28 | dependency=${dependency#$pwd/} |
| | 29 | ;; |
| | 30 | $builddir/*) |
| | 31 | dependency="\$(builddir)/"${dependency#$builddir/} |
| | 32 | ;; |
| | 33 | esac |
| | 34 | |
| | 35 | case "$dependency" in |
| | 36 | /*) ;; |
| | 37 | $sourceFile) ;; |
| | 38 | \$\(builddir\)/xc_processor.h) |
| | 39 | echo -n " \$(XCACHE_PROC_H)" |
| | 40 | ;; |
| | 41 | \$\(builddir\)/xc_processor.c.h) |
| | 42 | echo -n " \$(XCACHE_PROC_C)" |
| | 43 | ;; |
| | 44 | *) |
| | 45 | if [[ -r $dependency ]]; then |
| | 46 | echo -n " \$(srcdir)/$dependency" |
| | 47 | else |
| | 48 | echo "$dependency not found" >&2 |
| | 49 | fi |
| | 50 | esac |
| | 51 | done |
| | 52 | echo |
| | 53 | done > Makefile.frag.deps |
| | 54 | exit |