dear Experts,
please help,
actually i am trying to create a .so(shared object through make file through ld)
i am not understaning how to proceed i have tried like
through command like i can do it in 2 step like
my progam :test2.c
$gcc -fPIC -c test2.c
$ld -shared -soname test2.so -o test2.so -lc test2.o
this gives me so
but same thing i am trying to achiee through Makefile
PROGRAM = test2.c
INCLUDEDIRS = \
-I$(ARCENGINEHOME)/include \
-I/usr/X11R6/include
LIBDIRS = \
-L$(ARCENGINEHOME)/bin \
-L/usr/X11R6/lib
LIBS = -larcsdk //here it is giving me error
CXXSOURCES = test2.c # list of source files
CXXOBJECTS = $(CXXSOURCES:.c=.o) # expands to list of object files
CXXFLAGS = -DESRI_UNIX $(INCLUDEDIRS)
CXX = g++
LDFLAGS = $(LIBDIRS) $(LIBS)
all: $(PROGRAM)
$(PROGRAM): $(CXXOBJECTS)
$(CXX) -o $@ $(CXXOBJECTS) $(LDFLAGS)
basic_sample.o: basic_sample.cpp basic_sample.h
$(CXX) $(CXXFLAGS) -c -o basic_sample.o basic_sample.cpp
clean:
$(RM) -f $(CXXOBJECTS) $(PROGRAM)
run:
./$(PROGRAM)
[/code]
but here i want to add test.a which takes the object files like
ar -ur test2.a test2.o
and through this i want to create test2.so
please help me how to achieve this.
expecting your help.