#
#                             stb225 Project
#                   ---------------------------------
#
# Copyright (C) 2006 Koninklijke Philips Electronics N.V.,
# All Rights Reserved.
#
# Filename: cbuildconfig.pl
#
# Perl syntax configuration file for cbuild SDE2 build tool.
#
# Rev Date       Author      Comments
#-------------------------------------------------------------------------------
#   1 20060209   batelaan    Initial
#   2 20060322   batelaan    Correct environments labels. We don't know if it is big or little endian here
#   3 20060407   ogilvie     Add x86 configs
#   4 20060801   batelaan    Use new environments mechanism
#   5 20060809   batelaan    Crosscheck fix
#   6 20060815   batelaan    Ensure list is not empty when calling registerEnvSet
#   7 20060830   batelaan    Add exp (experimental) option to envs.list target invocation.
#                            Abbreviate new environments.
#   8 20061117   batelaan    Use make -s to prevent unwanted diagnostics from make.
#   9 20070102   batelaan    Prevent MAKEFLAGS filtering down to sub make invocation.
#  10 20070123   batelaan    Remove registering environments; unused.

# Don't register any environments, we don't use this cbuild mechanism.

#-------------------------------------------------------------------------------
# Standardise on Trimedia compiler CC format: "filename", line DDD: ....
setLocationFormatter(sub { "\"$_[0]\", line $_[1]:"; });

# Trimedia CC output: src/tmMUti_Vec.c", line 228:
#registerLocationEditor(sub { s/^"([^"]+)", line (\d+):/main::getLocation($1, $2)/e; },
#                       '"c:/cex/comps/tmMUti/src/tmMUti_Vec.c", line 228: error: ...',
#                       '"c:/cex/comps/tmMUti/src/tmMUti_Vec.c", line 228: error: ...');

# GNU CC output: src/tmMUti_Vec.c:76: 
registerLocationEditor(sub { s/^(.*?):(\d+):/main::getLocation($1, $2)/e; },
                       'c:/cex/comps/tmMUti/src/tmMUti_Vec.c:76: parse error before ...',
                       '"c:/cex/comps/tmMUti/src/tmMUti_Vec.c", line 76: parse error before ...');

# Microsoft Visual Studio:
#        c:/OSD/comps/tmOsd/inc\tmOsd.h(51) :
registerLocationEditor(sub { s/^\s*([^)]+)\((\d+)\) :/main::getLocation($1, $2)/e; },
                       '   c:/OSD/comps/tmOsd/inc\tmOsd.h(51) : ...',
                       '"c:/OSD/comps/tmOsd/inc\tmOsd.h", line 51: ...');

# QMore output:
registerLocationEditor(sub { s/^(.*)file - +([^ ]+) (.*?) ?at line:(\d+)/main::getLocation($2, $4) . " $&"/e; },
                       'ERROR file - c:/comps/tmMUti_CmdLocal.h ... at line:77 blabla',
                       '"c:/comps/tmMUti_CmdLocal.h", line 77: ERROR file - c:/comps/tmMUti_CmdLocal.h ... at line:77 blabla');

# QAC output: src/tmMUti_Cmd.c(191)
registerLocationEditor(sub { s/^([^)]+)\((\d+)\)/main::getLocation($1, $2)/e; },
                       'c:/tmp/tmMUti/src/tmMUti_Cmd.c(191) blabla',
                       '"c:/tmp/tmMUti/src/tmMUti_Cmd.c", line 191: blabla');

# SDE2 output: compiling src/xxx.c
registerLocationEditor(sub { s/^(compiling )(.*)/$1 . main::makeAbsolute($2)/e; },
                       'compiling c:/x',
                       'compiling c:/x');

# Register location directory extractor for SDE2 build_exe.pl:
registerDirectoryExtractor(sub { /^Building: (.*?) for / ? $1 : undef; },
                           'Building: c:/kernel/comps/tmbslCore for ...',
                           'c:/kernel/comps/tmbslCore');

registerDirectoryExtractor(sub { /^Executing the target\(s\) .*? for (\S+)/ ? $1 : undef; },
                           'Executing the target(s)  all _sde_suppress_dlls for /home/batelaan/nxlinux/ipstb/src/ndk/ndk_root/vproc/comps/tmVprocTvFlows',
                           '/home/batelaan/nxlinux/ipstb/src/ndk/ndk_root/vproc/comps/tmVprocTvFlows');

#-------------------------------------------------------------------------------
#$a = Option->new("refappdoc", "-refappdoc");
#$a->setUsage("-refappdoc", "Run RefApp/docs/doxygen/generate.bat");
#$a->setOptionParser(
#  sub {
#    main::cd("$ENV{'PRJROOT'}/RefApp/docs/doxygen");
#    main::runCmd("generate.bat");
#  }
#);
