User`s guide

2 Setting Up Your Build Environment
2-20
Creating a Makefile Based on the Demo Adaptor Makefile
To create a makefile to build your adaptor based on the demo adaptor makefile, follow
these instructions.
1
Make a copy of the adaptor kit demo makefile and put it in your adaptor
development folder. For example, if your adaptor development folder is /home/
my_folder/my_adaptor, you might execute this command at the system prompt:
cd /home/my_folder/my_adaptor
cp $(MATLAB_ROOT)/toolbox/imaq/imaqadaptors/kit/demo/makefile my_makefile
where MATLAB_ROOT is your MATLAB installation folder.
2
Open your copy of the makefile in any text editor.
3
Specify the folder where you want to create your adaptor by setting the value of the
ADAPTOR_DIR variable. By default, the demo adaptor makefile puts the adaptor in a
subfolder of your development folder called build, but you can put your adaptor in
any folder. When you are finished creating your adaptor, register it with the Image
Acquisition Toolbox by using the imaqregister function.
4
Specify the location of your MATLAB installation folder by setting the value of the
MATLAB_ROOT variable. You can specify a relative path or an absolute path.
5
Specify any libraries required by your hardware device's SDK by setting the value of
the LIBS variable. The demo adaptor makefile already specifies the library required
by the adaptor kit: libmwimaqmex. The makefile drops the “lib” prefix and the
platform-specific file extension, such as .so, for these libraries because the linker
does not require them.
6
Specify any include file folders required by your hardware device's SDK by setting
the value of the INCLUDE_DIRS variable. The demo adaptor makefile already
specifies the include folders required by the adaptor kit.
7
Specify the name you want to give your adaptor by setting the value of the RESULT
variable. The makefile builds the demo adaptor, so it uses the naming convention for
a MathWorks adaptor, using the “mw” prefix. Do not use this convention for the name
of your adaptor. The line you modify depends on your development platform:
Platform Line
Number
Change
Linux 69 Specify the name, giving it the .so file extension.
Macintosh 90 Specify the name, giving it the .dylib file extension.