Custom compiler

From CodeBlocks
Revision as of 04:00, 23 August 2006 by Joda (Talk | contribs) (added information dug out from source)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

TODO Text about what custom compiler does.

Bison Example

For example enable Custom Compiler to generate a cpp file form a bison grammatic.

Given a bison file "myparser.ypp" in your source tree. Select properties, go to advanced tab, tick custom compiler and add the line "bison $file".

Note if you use the supplied mingw binaries, you have to define BISON_SIMPLE=%CB%\share\bison.simple, BISON_HAIRY=%CB%\share\bison.hairy as environment variables. Otherwise you could install http://gnuwin32.sourceforge.net/packages/bison.htm (Setup, without binaries has all required DLLs) and just add the "bin" directory to your System's PATH environment variable.

Compiler Parameters

  • $compiler
  • $linker
  • $lib_linker
  • $rescomp
  • $options
  • $link_options
  • $includes
  • $res_includes
  • $libdirs
  • $libs
  • $file - current file being compiled
  • $dep_object
  • $object
  • $resource_output
  • $exe_output
  • $exe_output
  • $link_resobjects
  • $link_objects
  • $link_flat_objects
  • $static_output
  • $def_output
  • MACROS - also all macros are applied to the commandline string

The following were added to support the QUICK HACK in compiler plugin: DirectCommands::GetTargetLinkCommands()

  • $+link_objects
  • $-link_objects
  • $-+link_objects
  • $+-link_objects

Implementation Details can be found here: http://svn.berlios.de/svnroot/repos/codeblocks/trunk/src/sdk/compilercommandgenerator.cpp