Notes on the ARC build process:

1. To build the cpe with different AFE flavors, use the build_socrates_"afe_name".bat
This bat file will create  a file called .build_info.txt which list all build options.
Looking at this file, you can tell what the current image has been built for.


2. Once you have run one of the above .bat files, you could use build_obj.bat
to create specified .o or .rls files. This bat file will make
use the information in .build_info.txt to save your time by skipping unneccessary
build steps (like extracting info from MSVC, creating codeswap super files...)
and jumping right into making .rls, .o for you.

This bat file is especially helpful when you have to fix the compiler errors
on some specific files. For example, if you fail to generate file_x.rls
then make the code change to fix the problem and then run


    build_obj.bat file_x.rls


if you fail to compile file_x.c, you could run


    build_obj.bat file_x.o


You could do that to multiple of files:


    build_obj.bat file_x.rls file_y.rls  file_z.rls
    build_obj.bat file_x.o file_y.o file_z.o



3. Timestamp change detection is implemented to rebuild the object file when any
source files in the dependency list (.rls) changes.

You DON'T have to clean and rebuild if you resynch to MKS files or
back out to an older version of files. The build process will detect timestamp change
(older or newer, as long as they're different) on source files and force the changed
files to be rebuilt. This will save you a lot of time in long run.


4. When some check-ins removing old files, you have to make sure that you remove those files.


5. When changing build files like vdsl_modem.mak, *.src, *.inc files, please make sure to
be case sensitive as much as possible, and also try to use the Unix / in path names instead
of the DOS \. Why? the compiler, and make are Unix based tools and they are picky about these. :)

6. The build nows relies on the path information in *.src filea. When updating platform.src,
    make sure you have the right paths for the source files.



!!!!!!!!!!!!!!!! A Brief Description of the Implementation of the Build Process !!!!!!!!!!!!!!!!!!!!

The whole build process is executed base on "rules" in vdsl_modem.mak.

The build process will be described by explaining each of its steps and the associated
script/bat files:


step 0
    To make a build run one of the following .bat files:

    build_socrates_"afe-name".bat

    These files will set some local environment variables to communicate the master .bat
    file, build_codeswap_hw.bat.

step 1
    Build_codeswap_hw.bat will first check if the current build options are the same with
    the previous build. If not a clean will be executed.

step 2
    invoking gmake to generate .src and .inc files from the corresponding MSVC .dsp
    files. The perl script get_src_frm_dsp.pl will be executed to achieve this step.

    The .src file contains the paths and names of files to be compiled. The .src files use
    gmake syntax.

    The .inc file contains include paths needed for the compilation. The .inc files use
    syntax of the command line arguments for hcarc compiler.

step 3
    invoking gmake to generate intermediate files related to codeswap build. The perl
    script setup_codeswap.pl will be run to achieve this step.

    Input files to the perl script consists of vcx_inputs.cmd and *.src files.
    The script will process the vcx_inputs.cmd to:
    1. generate super file SWAP_*.c under soc_src\modem\codeswap_source directory
    2. generate the ultimate .cmd file used by the linker (for eg. modemhwe_hw.cmd)
    3. generate the soc_src\modem\include\Modemhwe_swap_index.h file which contains
    swap page names and their corresponding numbers.

step 4
    invoking gmake to check the source file time stamps to force rebuild.
    During this step if a source file has timestamp different (not neccessarily newer)
    from its previous version, the corresponding .rls and .o of all files depending
    on this source file will be removed to force a re-compilation on them.

    This step is achieved by running the check_source_timestamps.pl script.

step 5
    invoking gmake to generate .rls files for all objects. Each .rls file is just
    gmake rule to generate object file (.o) from a source file and the rule to
    regenerate the .rls file itself. .rls files are in gmake syntax.

    gen_C_rls.pl and gen_ASM_rls.pl will be run during this step. Output .rls files
    are under make_rls\vcx

step 6
    invoking gmake to generate the list of source file time stamps for this current
    build. This list will be used as input in step 4 when running the build again.

    This step is achieved by running the check_source_timestamps.pl script.

step 7
    invoking gmake to generate objects for all files, link objects to generate .out file
    and invoking arc simulator to generate the image .bin file.

    After .out and .bin files created successfully, MemSize.pl will be run to generate
    the memory usage report (for eg. map\vco_hw_mem.xls), and ImageCheck.pl will be run
    to generate the swap page cross reference report (for eg., map\vco_hw_cross_ref.txt).

Note that in between each step, the perl script sleep.pl was run to work around the
gmake timestamp problem. Windows timestamp doesn't have enough resolutions and sometimes
gmake can't perform timestamp checks correctly.




