makefile

10 views
Skip to first unread message

hayder mohammed

unread,
Oct 5, 2010, 4:39:09 AM10/5/10
to SIGVerse-users
Hi Every one,

I facing a problem with compile my file from *.cpp to *.so when I run
my make file the server become freeze,and I cannot access to
socio.iir.nii.ac.jp the attach file is the makefile is this way
correct to comiple file from *.cpp to *.so
this makefiel in my directory home/hayder/sigverse-100317-fix/share/
sigverse/samples

# $Id: Makefile.controller.in,v 1.2 2009/12/17 02:10:43 yoshi Exp $

CXX = g++

USER = `whoami`

#SIGVERSE_DIR = /home/hayder/sigverse-100317-fix
#SIGVERSE_DIR = $(HOME)/sigverse-100317-fix


DEFINE = -DUSE_ODE -DCONTROLLER -DdDOUBLE
INCLUDE = -I /home/hayder/sigverse-100317-fix/include -I /home/hayder/
sigverse-100317-fix/include/sigverse
#INCLUDE = -I $(SIGVERSE_DIR)/include -I /home/hayder/sigverse-100317-
fix/include/sigverse
CXXFLAGS = $(INCLUDE) $(DEFINE) $(DEBUG)

LD = $(CXX)

.SUFFIXES: .cpp .so .o

.cpp.so:
$(LD) -shared -o $@ $(CXXFLAGS) -fPIC $<

# SRCS = SendMsg.cpp onRecvMsg.cpp
SRCS = mobileController.cpp

LIBS = $(MODEL_SRCS:.cpp=.so)


all:
$(MAKE) $(LIBS)


clean:
$(RM) *.o *.so *~

Tetsunari Inamura

unread,
Oct 6, 2010, 6:31:32 AM10/6/10
to sigvers...@googlegroups.com
Hi Hayder,

This problem is not domain of SIGVerse server.
If you don't know how to write Makefile, how about reading
tutorial of Makefile such as
http://mrbook.org/tutorials/make/ ?

A macro MODEL_SRCS is used in your Makefile, but it is not defined.
I think MODEL_SRCS should be changed to just SRCS

Change: LIBS = $(MODEL_SRCS:.cpp=.so)
To: LIBS = $(SRCS:.cpp=.so)

Tetsunari Inamura,

hayder mohammed

unread,
Oct 7, 2010, 9:53:37 PM10/7/10
to SIGVerse-users
Hi Sensei

I followed the following way to compile form *.cpp to *.so and its
success.

This makefile

SRCDIR=/home/hayder/irwas-sim-100317-fix/srcs

.SUFFIXES: .cpp .so

.cpp.so :

g++ -shared -o $@ -fPIC -DNDEBUG -DUSE_ODE -DCONTROLLER -I ./comm -I $
(SRCDIR)/model -I $(SRCDIR)/model/commonlib $<

After that I copied this makefile to my /home/hayder/sigverse-100317-
fix/share/sigverse/samples/

And run this command in linux or cygwin.
make TestController.so

hayder,



On Oct 6, 1:31 pm, Tetsunari Inamura <inam...@nii.ac.jp> wrote:
> Hi Hayder,
>
> This problem is not domain of SIGVerse server.
> If you don't know how to write Makefile, how about reading
> tutorial of Makefile such ashttp://mrbook.org/tutorials/make/?
>
> A macro MODEL_SRCS is used in your Makefile, but it is not defined.
> I think MODEL_SRCS should be changed to just SRCS
>
> Change:  LIBS = $(MODEL_SRCS:.cpp=.so)
> To:      LIBS = $(SRCS:.cpp=.so)
>
> Tetsunari Inamura,
>
> >    $(RM) *.o *.so *~- Hide quoted text -
>
> - Show quoted text -

hayder mohammed

unread,
Oct 7, 2010, 10:02:16 PM10/7/10
to SIGVerse-users
Hi Sensei,

I followed the following way and its success:-

Firstly, I wrote the following makefile


SRCDIR=/home/hayder/irwas-sim-100317-fix/srcs

.SUFFIXES: .cpp .so

.cpp.so :
g++ -shared -o $@ -fPIC -DNDEBUG -DUSE_ODE -DCONTROLLER -I ./comm -I
$(SRCDIR)/model -I $(SRCDIR)/model/commonlib $<

Secondly, I copied this makefile to my directory /home/hayder/
sigverse-100317/share/sigverse/samples.

Thirdly, I type this command in linux or cygwin
make mobileController.so

hayder

On Oct 6, 1:31 pm, Tetsunari Inamura <inam...@nii.ac.jp> wrote:
> Hi Hayder,
>
> This problem is not domain of SIGVerse server.
> If you don't know how to write Makefile, how about reading
> tutorial of Makefile such ashttp://mrbook.org/tutorials/make/?
>
> A macro MODEL_SRCS is used in your Makefile, but it is not defined.
> I think MODEL_SRCS should be changed to just SRCS
>
> Change:  LIBS = $(MODEL_SRCS:.cpp=.so)
> To:      LIBS = $(SRCS:.cpp=.so)
>
> Tetsunari Inamura,
>
Reply all
Reply to author
Forward
0 new messages