aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp.test/GNUmakefile.dependency.sh
blob: 0d2b65a5ef1eddde94691105162767a1fa11c736 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/sh

out=`echo "$2" | sed -e 's/\\//\\\\\//g'`

echo $1 \
    | sed -e 's/\\ / /g' \
    | sed -e ':x; /\\$/ {N;s/\\\n//; tx};' \
    | sed -e 's/.*://g' \
    > $2.$$
rm -f $2
cat $2.$$ \
    | sed -e 's/^/'$out'::/g' \
    >> $2
printf '\t%s "`%s %s $<`" $@\n' \
    '$(DEPENDENCY_CREATER)' \
    '$(CXX_DEP)' \
    '$(CXXFLAGS)' \
    >> $2
cat $2.$$ \
    | sed -e 's/  */\n/g' \
    | sed -e 's/$/::;/g' \
    | sed -e 's/^::;$//g' \
    >> $2
rm -f $2.$$