|
Nmake
[Back]
A shell script which can be used to run make
from NEdit.
#! /bin/sh
exec 2> /dev/null
while true ; do
sh -c 'echo $$ ; exec sleep 2147483647' > $HOME/.sleeppid
make 2>&1 | tee .nmake_output
echo ""
echo ""
done
Use this macro to run make:
$mopos = 0
save()
shell_command("kill `cat ~/.sleeppid`", "")
The following will go to any errors produced:
mo = read_file(".nmake_output")
# skip past any compiler lines
while (substring(mo, $mopos, $mopos+3) == "g++")
{
search_string(mo, "$", $mopos, "regex")
$mopos = $search_end + 1
}
# check for make's error message
if (substring(mo, $mopos, $mopos+3) == "***")
{
beep()
}
else
{
errl = -1
while (errl == -1)
{
# get filename and line number
brk = search_string(mo, ":", $mopos)
fname = substring(mo, $mopos, brk)
search_string(mo, ":", brk+1)
errl = substring(mo, brk+1, $search_end-1)
# discard any message lines
if (substring(mo, brk+2, brk+7) == "In fu" || \
substring(mo, brk+2, brk+7) == "In me" || \
substring(mo, $search_end+1, $search_end+6) == "(Each" || \
substring(mo, $search_end+1, $search_end+6) == "for e")
errl = -1
# goto next line
search_string(mo, "$", $mopos, "regex")
$mopos = $search_end + 1
}
# goto file and line
focus_window(fname)
goto_line_number(errl)
}
[Back]
Released on Wed, 21 Nov 2001
by
C. Denat
|
|