Include CPP preprocessor dependencies in -M output
[ghc.git] / testsuite / tests / driver / T16521 / check.sh
1 #! /bin/sh
2
3 checkDups() {
4 # Check for duplicate lines
5 if [ $(uniq $1 -d | wc -l) -ne 0 ]
6 then
7 echo "Duplicate dependencies:"
8 uniq $1 -d
9 fi
10 }
11
12 expectDep() {
13 if ! grep -q $1 "$2" $3
14 then
15 echo "Missing: \"$2\""
16 fi
17 }
18
19 checkDups Makefile1.out
20 expectDep -F "A.o : A.hs" Makefile1.out
21 expectDep -F "A.o : a.h" Makefile1.out
22 expectDep -F "A.o : b.h" Makefile1.out
23 expectDep -F "A.o : b2.h" Makefile1.out
24 expectDep "" "A\.o : .*/ghcversion.h" Makefile1.out
25 expectDep "" "A\.o : .*/processFlags.h" Makefile1.out
26
27 checkDups Makefile2.out
28 expectDep -F "A._o A.o : A.hs" Makefile2.out
29 expectDep -F "A._o A.o : a.h" Makefile2.out
30 expectDep -F "A._o A.o : b.h" Makefile2.out
31 expectDep -F "A._o A.o : b2.h" Makefile2.out
32 expectDep "" "A\._o A\.o : .*/ghcversion.h" Makefile2.out
33 expectDep "" "A\._o A\.o : .*/processFlags.h" Makefile2.out