summaryrefslogtreecommitdiff
path: root/MK
blob: 347f885489d1f7673a872d575422981c86c9d817 (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
29
30
31
32
33
34
35
36
#!/bin/bash
#
# Run 'make', saving all output into a file named LOG
#
# usage:
#	MK  [args]   - prints timestamps and status
#	MKV [args]   - echoes and saves 'make' output
#

# remember this so we know what to do
name="`basename $0`"

# starting timestamp
time1="`date`"

if [ "$name" = "MK" ]
then
	# run make, save output, check status
	echo -n + make $* '> LOG 2>&1 ... '
	if make $* > LOG 2>&1
	then
		echo done
	else
		echo check LOG for build errors
	fi
else
	# just do the make and save a copy of the output
	echo + make $* '2>&1 | tee LOG'
	make $* 2>&1 | tee LOG
fi

# ending timestamp
time2="`date`"

echo  Start: $time1
echo "End:  " $time2