CHDK/Compiling CHDK under Windows

To compile CHDK under Windows you need Unix-like environment as Cygwin or Mingw/MSys. Also, it is assumed that you have basic knowledge of Windows console using.

The working environment
There is the 'ready-to-use' environment which you can get here.

The environment

 * Create a folder for CHDK project. For example, D:\CHDK.
 * Create a subfolder for working environment. For example, D:\CHDK\gcc.
 * Unpack the archive with the environment into this folder.
 * Add the folder with binaries tho the PATH environment variable.
 * (Open 'Start' -> 'Control Panel' -> 'System', 'Advanced' tab, 'Environment Variables' button. I used User Variables for that. If there is no PATH variable then just create it and assign 'D:\CHDK\gcc\bin' to it. If PATH variable already exists then append the value ';D:\CHDK\gcc\bin' (be noticed about the delimeter ';' (semicolon). Apply the new environment settings.)

The sources

 * Create working directory. For example, D:\CHDK\src.
 * Download latest sources from SVN-repository: tools.assembla.com into created directory.
 * You can use SVN-client for windows or just download sources as ZIP-archive directly from tools.assembla.com. (If you get the sources through ZIP-file, please check whether the folder 'bin' exists in the top sources direstory.)

Compilatiaon process
Change the current directory to top sources directory. Then type: gmake fir

By default, CHDK is compiled only for A610, fw1.00e. If you want to compile firmware for an another camera, just execute make with PLATFORM and PLATFORMSUB arguments. For example: gmake PLATFORM=a620 PLATFORMSUB=100f fir

To compile firmware for all cameras just type: gmake batch-zip

Conflicts with Borland products
If there are Borland compilers in the PATH it can lead to compile failures due to using wrong binaries with same names as for working environment. For example: >> Entering to platform/a620/sub/100f boot.c -> boot.o stubs_min.S -> stubs_min.o boot.c -> stubs_auto.S stubs_auto.S -> stubs_auto.o -> stubs_entry.S CAUTION! 'stubs_entry.S' is not uptated due to target firmware binary not found! Touch Version 4.2 Copyright (c) 1998 Borland International ERROR! There are unresolved addresses in 'stubs_entry.S' (a620-100f) for the following names: File stubs_entry.S: free Please, add them into 'stubs_entry_2.S' manually!

To avoid such messages just isolate Borland products (e.g., by modifying the PATH variable).