blob: 568fcd6d56ec28e7a456ce0792056bba83c843a7 [file] [log] [blame]
Dan Nicholsond7eb97b2007-10-23 18:17:16 -07001#!/bin/bash -e
2
3usage()
4{
5 echo "Usage: $0 <target1> <target2>"
6 echo "Highlight differences between Mesa configs"
7 echo "Example:"
8 echo " $0 linux linux-x86"
9}
10
11die()
12{
13 echo "$@" >&2
14 return 1
15}
16
17case "$1" in
18-h|--help) usage; exit 0;;
19esac
20
21[ $# -lt 2 ] && die 2 targets needed. See $0 --help
22target1=$1
23target2=$2
24
25topdir=$(cd "`dirname $0`"/..; pwd)
26cd "$topdir"
27
28[ -f "./configs/$target1" ] || die Missing configs/$target1
29[ -f "./configs/$target2" ] || die Missing configs/$target2
30
31trap 'rm -f "$t1" "$t2"' 0
32
33t1=$(mktemp)
34t2=$(mktemp)
35
36make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t1
37TOP = .
38include \$(TOP)/configs/$target1
39default:
40EOF
41
42make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t2
43TOP = .
44include \$(TOP)/configs/$target2
45default:
46EOF
47
48diff -pu -I'^#' $t1 $t2