Creating a client project and configuring Make support for it
template.Makefile
file from your
SNIFF_DIR/config
directory to
your
grid_server
directory and rename it
Makefile.client.
This is your client Makefile.
You will now create a project for the client.
Start SNiFF+.
In the Launch Pad, select Project > New Project... > with Defaults...
In the Directory dialog that appears, navigate to the
grid_server
directory.
Press Open and the Select.
The Attributes of New Project dialog appears.
In the Attributes of a New Project dialog
In the General view > File Name and Type field, enter
grid_client
.
Select the General > Advanced node.
In the Advanced view > Generated Files Directory field, enter
.sniffdir_client
.
Select the Build Options node.
In the Build Options view, enter a Make command in the Make Command field, so that
Make uses the project Makefile
Makefile.client
instead of the default Makefile.
Example:
make -f Makefile.client
Select the Build Options > Project Targets node.
In the Executable field, enter the executable target name (e.g.,
grid_client
)
In the +Libraries Linked field (below the Executable field), enter
$(IDL_client_LIB).
Select the File Types node.
In the File Types view, select the Make file type (by single-clicking it) and delete the entry
in the General tab > Signatures field. Then enter
Makefile.client
in this field.
Press the Show All button to see all the file types.
For each of the following file types, select the file type (in the order given) and then press
the Add File Type button:
- IDL Interface
- IDL Header
- IDL Client Implementation
- IDL Client Object
Now, files of this file type will be added to the grid_client project during project creation.
Press OK to create the project.
In the dialog that appears asking if you want to generate cross reference information,
press No.
Add client source files to the project by copying these files to the
grid_server
directory
and then choosing Project > Add/Remove Files to/from grid_client.shared... in
the Project Editor. Remove server source files from the project and make sure that only
client files are part of the project.
You are now ready to edit and then run the Makefile for your client project.
Edit
Makefile.client
.
The following example shows part of your Makefile. The IDL-specific commands are
highlighted in boldface. Make sure that these commands are in your Makefile. If they are
not, please add them:
# Project makefile
# Location of make support files
SNIFF_MAKEDIR = .sniffdir_client
# Include the generated make support files
include $(SNIFF_MAKEDIR)/macros.incl
# The following macros are defined in the Make view of the
project attributes
# Include directive(s)
$(SNIFF_INCLUDE)+= -I$(IDL_INCDIR)
# Executable target
LINK_TARGET = $(SNIFF_LINK_TARGET)
# Relinkable object target
RELINK_TARGET = $(SNIFF_RELINK_TARGET)
# Library target
LIB_TARGET = $(SNIFF_LIB_TARGET)
# Libraries received from subprojects.
# Linked to executable and relinkable object target.
SUB_LIBS = $(SNIFF_SUB_LIBS)
# Relinkable objects received from subprojects.
# Linked to executable, relinkable object and library
target.
SUB_RELINK_OFILES = $(SNIFF_SUB_RELINK_OFILES)
# Other libraries linked to executable target
OTHER_LIBS = $(SNIFF_OTHER_LIBS)
# Other libraries linked to relinkable object target
RELINK_OTHER_LIBS = $(SNIFF_RELINK_OTHER_LIBS)
# Recursive make directories
SUBDIRS = $(SNIFF_SUBDIRS)
# you can define the following additional flags here
#
#OTHER_OFILES = <other object files>
#OTHER_CFLAGS = <other C compiler flags>
#OTHER_CXXFLAGS = <other C++ compiler flags>
#OTHER_YACCFLAGS = <other yacc compiler flags>
#OTHER_LEXFLAGS = <other lex flags>
# IDL-specific macros
OTHER_IDLFLAGS = -B
#OTHER_FFLAGS = <other fortran compiler flags>
OTHER_LDFLAGS = -L$(IDL_LIBDIR)
# PRE_TARGETS is currently used only for IDL make support.
# The PRE_TARGETS macro is needed, since it is not possible
to
# create a simple implicit rule to compile the IDL files
PRE_TARGETS = $(SNIFF_PRE_TARGETS)
# IDL-specific macro
# "S" stands for server and "C" for client
IDL_CFILE_TYPE_SPEC = C
# Common makefile definitions
include $(SNIFF_DIR)/make_support/general.mk
# Include the generated dependencies file
include $(SNIFF_MAKEDIR)/dependencies.incl
In the Project Editor
In the Project Tree, double-click on
grid_client.proj
.
The Project Attributes dialog appears.
In the Project Attributes dialog, select the Build Options > Directives node.
In the Directives view, press the Generate... button to the right of the Include Directive(s)
field.
The include directives for this project are now generated and appear in the Include
Directive(s) field.
In the Project Editor, choose Target > Update Makefiles... to update the generated Make
support files.
Press Yes in the dialog that appears.
Choose Target > Make... > grid_client to build the project's target.
gridC.cc
and
grid.hh
will be created by the IDL compiler and then
gridC.o
will
be created by the C++ compiler.
Make sure that
grid_client.proj
is selected in the Project Tree and choose
Project > Reload Project... > In Current Working Environment.
You should now see the
gridC.cc
and
grid.hh
files in the Project Editor's File List.
You have just completed configuring Make support for the client project.
This completes the Make support setup for your IDL server and client projects.