Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Building Generated C Code for a Specific Target (C Generator)

LabVIEW 2011 C Generator Help

Edition Date: June 2013

Part Number: 373144C-01

»View Product Info

When you build the C Code Generation build specification, the LabVIEW C Generator generates C code files and makefiles. Makefiles describe how to create an external application based on target requirements and dependencies. You use the GNU Make utility to build applications and libraries automatically from the generated C code. The C Generator generates the following makefiles:

  • Makefile is an example makefile. When you use the make command, the GNU Make utility reads this file. After the C Generator generates Makefile, the C Generator does not overwrite this file if you regenerate the C code. If you want to generate a new example Makefile, you must delete the file before regenerating the C code.
  • dependencies.mk is the secondary makefile. The C Generator includes all LabVIEW settings, such the build specification name and C code generation option values, that are required to generate C code. The C Generator updates this file if the hierarchy of the exported VI changes. LabVIEW also automatically overwrites this file during the build process.

Before you can run the Makefile, you must complete the following steps to setup the required toolchain.

  1. Install GNU Make for Windows. Makefile is formatted to run only on the GNU Make utility. Refer to the Make for Windows Web site at http://gnuwin32.sourceforge.net/packages/make.htm to install the GNU Make utility.
  2. Setup the PATH environment variable in Windows to include make.exe.
  3. Install a compiler for the target on which you want the external application to run. By default, Makefile uses the Microsoft Visual Studio compiler. The VSPATH variable in Makefile specifies the location of the Microsoft Visual Studio compiler.
  4. Setup the environment for the compiler. Refer to the compiler documentation for more information about setting up the environment.

You must edit the Makefile to customize compiler and linker options, dependencies, and build rules.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit