Mail Archives: djgpp/1997/08/09/21:23:54
Yojimbo wrote:
>
> I'm very new to DJGPP, and I've been trying to find a way to capture the
> messages to a file. After a lot of dinking around, I've got a way that
> works very nicely, so I thought I'd pass it along. It involves the use
> of a very nice utility called SCRIPT.
>
> First, get a copy of the SCRIPT11.ZIP distribution file. It is available
> from:
> ftp://ftp.coast.net/coast/msdos/screen/script11.zip
> Extract the executable file and store it in a directory that is on your
> PATH.
>
> Now prepare a batch file which will invoke script and call another batch
> file from script. I used something like this:
>
> script -f c:\misc\err.log command /c call maker %1
>
> I named this batch file mkr.bat, and when I call it, I pass the name of
> my source file WITHOUT the .cc extension. For example, if I have a
> source file name SOURCE.CC I would type MKR SOURCE at the prompt. The
> batch file saves a lot of typing.
>
> MAKER.BAT does the real work. It looks something like this:
>
> @echo off
> gcc -o %1.o -c -I. -g %1.cc
>
> gxx -o %1 %1.o %djgpprun%/djgpp/lib/stharch.a
>
> You'll want to make sure you use fully qualified file names that reflect
> the way your system is set up.
>
> The gcc and gxx commands are based on files accompanying the book "Who's
> Afraid of C++" by Steven Heller.
>
> I hope this is useful.
Or you can use the redir.exe utility that comes with DJGPP. Simply say
redir -o output.log -e error.log make all (or any other command)
and stdout will be redirected to output.log while stderr will be
redirected to error.log.
--
Weiqi Gao
weiqigao AT a DOT crl DOT com
- Raw text -