c++ - omniorb makefile server error -


im doing adition simple program on omniorb 4.2 makefile server gives me error. heres makeserver file code:

cc            = gcc cppflags      = -g -c ldflags       = -g omni_home     = /opt/omniorb omni_includes = -i$(omni_home)/include omni_lib_dir  = $(omni_home)/lib omniidl       = $(omni_home)/bin/omniidl includes      = $(omni_includes) libs          = -lomniorb4 -lomnithread -lomnidynamic4 objects       = data.o cservicea.o server.o  server: $(objects)     $(cc) $(ldflags) -o server -l$(omni_home)/lib $(objects)         $(libpath) $(libs)  data.o: datask.cc data.hh     $(cc) $(cppflags) $(includes) datask.cc  server.o: server.cpp data.hh     $(cc) $(cppflags) $(includes) server.cpp  cservicea.o: cservicea.cpp cservicea.h data.hh     $(cc) $(cppflags) $(includes) cservicea.cpp  datask.cc: data.idl     $(omni_home)/bin/omniidl -bcxx data.idl  clean clean_all:     rm -fr *.o     rm -fr core     rm -fr *.hh     rm -fr *sk.cc     rm -fr server 

and error gives me:

$ make -f makeserver  gcc -g -c -i/opt/omniorb/include datask.cc gcc -g -c -i/opt/omniorb/include cservicea.cpp gcc -g -c -i/opt/omniorb/include server.cpp gcc -g -o server -l/opt/omniorb/lib data.o cservicea.o server.o  -        lomniorb4 -lomnithread -lomnidynamic4 gcc: error: data.o: file or directory doesn't exist makeserver:13: fail in instructions objective 'all' make: *** [all] error 1 

the following rule broken

data.o: datask.cc data.hh     $(cc) $(cppflags) $(includes) datask.cc 

you've told make rule creates data.o, creates datask.o, change rule , objects

objects       = datask.o cservicea.o server.o  datask.o: datask.cc datask.hh     $(cc) $(cppflags) $(includes) datask.cc 

as side note, lot of makefile unnecessary, built-in rules , gcc dependency generation can cover of work:

omni_home := /opt/omniorb  cppflags := -i$(omni_home)/include -mmd -mp cxxflags := -g ldflags  := -l$(omni_home)/lib ldlibs   := -lomniorb4 -lomnithread -lomnidynamic4  objs := datask.o cservicea.o server.o deps := $(objs:.o=.d)  .phony: clean  all: server  server: cc := g++ server: $(objs)  datask.o: datask.cc datask.cc datask.hh: data.idl     $(omni_home)/bin/omniidl -bcxx $<  clean: ; $(rm) $(objs) $(deps) datask.cc datask.hh server  -include $(deps) 

(the above may not work correctly haven't tested it.)


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -