See C:\> for /help for the gory details
I had googled up some references to "for /f", but decided I didn't really want to go down the path of invoking a batch script. (My batch programming skills are very close to non-existent.)
Besides, is it
really possible to write a batch script that will do the job of running "gcc -o file.exe file.c args" where args is the concatenation of ccopts() and ldopts(), and cannot be hard coded into the batch script ?
Of course, invoking a script to perform the task is not such a bad idea - but I think I'll make it a script that's at least readable:
use strict;
use warnings;
die "Usage: 'perl compile_it.pl filename'"
unless @ARGV == 1;
my $args = `perl -MExtUtils::Embed -e "ccopts"`;
chomp $args;
$args .= `perl -MExtUtils::Embed -e "ldopts"`;
chomp $args;
system "gcc", "-o", "$ARGV[0].exe", "$ARGV[0].c", $args;
Thanks holli.
Cheers,
Rob