summaryrefslogtreecommitdiff
path: root/Konzerte/2018_05_26/make-permanently
blob: 087f29e769b0346a6ce66b7709a9e201c686bdfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

while inotifywait -e DELETE_SELF $(
  find $(
    sed -n '
      :a
        \/\\$/ {
          N
          s/\\\n//
          ta
        }
      s/^\S\+: //
      T
      y/ /\n/
      p
    ' "$(dirname "$0")/Makefile" | \
      sed -n '
        s,^\(\(\.\./\)\+.\+\)/[^/]\+$,\1,
        T
        s/[^/]*%.*$//
        \,^\(\.\./\)*$,d
        p
      ' | \
      sort -u | tee /dev/stderr
    ) -type f
  ); do
  make
done