2
# Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
4
# This software is available to you under a choice of one of two
5
# licenses. You may choose to be licensed under the terms of the GNU
6
# General Public License (GPL) Version 2, available from the file
7
# COPYING in the main directory of this source tree, or the
8
# OpenIB.org BSD license below:
10
# Redistribution and use in source and binary forms, with or
11
# without modification, are permitted provided that the following
14
# - Redistributions of source code must retain the above
15
# copyright notice, this list of conditions and the following
18
# - Redistributions in binary form must reproduce the above
19
# copyright notice, this list of conditions and the following
20
# disclaimer in the documentation and/or other materials
21
# provided with the distribution.
23
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
## Makefile.am -- Process this file with automake to produce Makefile.in
35
# Support debug mode through config variable
42
AM_CXXFLAGS = $(DBG) $(OSM_CFLAGS)
45
INCLUDES = -I$(with_ibdm)/ibdm $(TCL_CPPFLAGS)
47
INCLUDES = -I$(with_ibdm)/include $(TCL_CPPFLAGS)
51
bin_PROGRAMS = ibmssh ibmsquit #ibmgtsim test_msgmgr test_client test_server ibmgt_client
54
# we assume we are building a parallel tree
56
IBDM_LIB=-L../../ibdm/ibdm -libdmcom
57
IBDM_INC=-I$(srcdir)/../../ibdm/ibdm
58
IBDM_IFC=$(srcdir)/../../ibdm/ibdm/ibdm.i
60
IBDM_PREFIX=$(with_ibdm)
61
IBDM_LIB=-L$(with_ibdm)/lib -libdmcom
62
IBDM_INC=-I$(with_ibdm)/include/ibdm
63
IBDM_IFC=$(with_ibdm)/include/ibdm/ibdm.i
66
AM_CPPFLAGS = -I$(INCLUDES) $(IBDM_INC) $(OSM_CFLAGS)
67
LDADD = $(IBDM_LIB) -lpthread
69
# AM_LDFLAGS = -static
71
# this is the main simulator
72
#ibmgtsim_SOURCES = sim.cpp server.cpp node.cpp dispatcher.cpp \
73
# msgmgr.cpp simmsg.cpp tcpcomm.cpp sma.cpp pma.cpp
74
#ibmgtsim_CPPFLAGS = -DBUILD_STANDALONE_SIM=1
76
ibmssh_SOURCES = sim.cpp server.cpp node.cpp dispatcher.cpp \
77
ibmssh_wrap.cpp sma.cpp pma.cpp vsa.cpp randmgr.cpp
79
ibmssh_LDFLAGS = -static -Wl,-rpath -Wl,$(TCL_PREFIX)/lib \
80
-Wl,-rpath -Wl,$(IBDM_PREFIX)/lib
82
ibmssh_LDADD = -libmscli $(IBDM_LIB) $(TCL_LIBS) -lpthread
84
ibmssh_DEPENDENCIES = libibmscli.la
87
SWIG_IFC_FILES= $(srcdir)/sim.i $(srcdir)/ib_types.i $(IBDM_IFC) \
88
$(srcdir)/inttypes.i $(srcdir)/mads.i
90
#$(srcdir)/sim.cpp: $(srcdir)/git_version.h
91
sim.o: $(srcdir)/git_version.h
93
# track latest GIT version for this tree:
94
GIT=$(shell which git)
96
$(srcdir)/git_version.h: @MAINTAINER_MODE_TRUE@ FORCE
97
if test x$(GIT) != x ; then \
98
gitver=`cd $(srcdir) ; git rev-parse --verify HEAD`; \
99
changes=`cd $(srcdir) ; git diff . | grep ^diff | wc -l`; \
101
gitver=undefined; changes=0; \
103
if test $$changes != 0; then gitver="$$gitver with-local-mods"; fi; \
104
echo "#define IBMGTSIM_CODE_VERSION \"$$gitver\"" > .git_version.h ;\
105
if test -f $(srcdir)/git_version.h ; then \
106
if test `diff .git_version.h $(srcdir)/git_version.h | wc -l` != 0; then \
107
mv -f .git_version.h $(srcdir)/git_version.h; \
108
echo "Updated code version to: $$gitver"; \
111
mv -f .git_version.h $(srcdir)/git_version.h; \
112
echo "Created code version file with version: $$gitver"; \
118
# only generate the swig wrappers if they do not exist...
119
# so we avoid un-needed swig dependency
121
$(srcdir)/ibms_wrap.cpp: @MAINTAINER_MODE_TRUE@ $(SWIG_IFC_FILES)
122
swig -I$(srcdir) $(IBDM_INC) -c++ -dhtml -tcl8 -o swig_wrap.c $(srcdir)/sim.i
123
$(srcdir)/../utils/fixSwigWrapper -g -s -p -o $@
126
$(srcdir)/ibmssh_wrap.cpp: @MAINTAINER_MODE_TRUE@ $(SWIG_IFC_FILES)
127
swig -I$(srcdir) $(IBDM_INC) -c++ -dhtml -tcl8 -ltclsh.i -o swig_wrap.c $(srcdir)/sim.i
128
$(srcdir)/../utils/fixSwigWrapper -g -s -p -r ibms -o $@
133
rm -f $(srcdir)/ibms_wrap.cpp $(srcdir)/ibmssh_wrap.cpp *wrap.o
135
# we need there extra in the distribution as their dependency is not defined
136
EXTRA_DIST = swig_alternate_mangling.cpp
138
# Quiter for the server
139
ibmsquit_SOURCES = client.cpp msgmgr.cpp simmsg.cpp tcpcomm.cpp
140
ibmsquit_CPPFLAGS = -DBUILD_QUIT_CLIENT=1 -I$(INCLUDES)
142
# tester of the client code
143
#ibmgt_client_SOURCES = client.cpp msgmgr.cpp simmsg.cpp tcpcomm.cpp
144
#ibmgt_client_CPPFLAGS = -DBUILD_TEST_CLIENT=1
146
# simple client program for testing
147
#test_client_SOURCES = tcpcomm.cpp msgmgr.cpp
148
#test_client_CPPFLAGS = -DBUILD_TCP_COMM_CLIENT=1
150
# simple server program for testing
151
#test_server_SOURCES = tcpcomm.cpp msgmgr.cpp
152
#test_server_CPPFLAGS = -DBUILD_TCP_COMM_SERVER=1
154
# testing message manager
155
#test_msgmgr_SOURCES = msgmgr.cpp simmsg.cpp
156
#test_msgmgr_CPPFLAGS = -DMSG_MGR_TEST=1
158
# client library to be used by OSMV type sim:
160
# ibms shared library version triplet is:
161
# API_ID:API_VER:NUM_PREV_API_SUP = x:y:z
162
# * change of API_ID means new API
163
# * change of AGE means how many API backward compt
164
# * change of API_VER is required every version
165
# Results with SO version: x-z:z:y
166
LIB_VER_TRIPLET="1:0:0"
167
LIB_FILE_TRIPLET=1.0.0
169
lib_LTLIBRARIES = libibmscli.la
171
libibmscli_la_SOURCES = client.cpp simmsg.cpp msgmgr.cpp tcpcomm.cpp
172
# -Wl,-rpath -Wl,$(TCL_PREFIX)/lib
173
libibmscli_la_LDFLAGS = -version-info $(LIB_VER_TRIPLET) -no-undefined
175
# we would like to export these headers during install
176
pkginclude_HEADERS = $(wildcard $(srcdir)/*.h)
178
# Don't distribute common.h, since it is build host dependent!
180
# rm -f $(distdir)/common.h