aboutsummaryrefslogtreecommitdiff
path: root/drivers/gator/gator_events.sh
blob: 5467dd6d17d630afda54cfa3cb7335d2ff76e714 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

EVENTS=`grep gator_events_init *.c | sed 's/.\+gator_events_init(\(.\+\)).\+/\1/'`

(
	echo /\* This file is auto generated \*/
	echo
	for EVENT in $EVENTS; do
		echo __weak int $EVENT\(void\)\;
	done
	echo
	echo static int \(*gator_events_list[]\)\(void\) = {
	for EVENT in $EVENTS; do
		echo \	$EVENT,
	done
	echo }\;
) > $1.tmp

cmp -s $1 $1.tmp && rm $1.tmp || mv $1.tmp $1