Git init
[external/ifupdown.git] / _darcs / current / makenwdep.sh
1 FILE=$1
2
3 if [ "$FILE" = "" -o ! -f "$FILE" ]; then
4         echo "Please specify a .nw file"
5         exit 1
6 fi
7
8 noroots $FILE | sed 's/^<''<\(.*\)>>$/\1/' |
9         while read chunk; do
10                 printf "%s : %s\n" "$chunk" "$FILE"
11                 case $chunk in
12                         *.pl|*.sh)
13                                 printf "\tnotangle -R\$@ \$< >\$@\n"
14                                 printf "\tchmod 755 %s\n" "$chunk"
15                                 ;;
16                         *.c)
17                                 printf "\tnotangle -L -R\$@ \$< | cpif \$@\n"
18                                 printf "include ${chunk%.c}.d\n"
19                                 ;;
20                         *.h)
21                                 printf "\tnotangle -L -R\$@ \$< | cpif \$@\n"
22                                 ;;
23                         *)
24                                 printf "\tnotangle -t8 -R\$@ $< >\$@\n"
25                                 ;;
26                 esac
27         done