I have searched everywhere to find some kind of help to create a
.so (shareable object) file as we see in SunOS /usr/lib/lib*.so.*
I tried various ways to modify my Makefile to achieve this but
haven't succeeded yet. I am therefore asking for your help. I
am aware of the fact that not many programmers create a .so file
and hence this question may not be in any FAQ.
The following was my best shot:
CC = /vol/PACK/SunPro.4/acc -sys5 -Xc \
-D_POSIX_SOURCE -DFUNCPROTO -D_XOPEN_SOURCE -w
#
# ========== .so: shared object library==========
CFLAGS = -I./ \
-I/vol/PACK/SunPro.3/SC3.0.1/include/cc_413_U1 \
-I${MOTIFHOME}/include \
-I/usr/xpg2include
CFLAGSX = -L${MOTIFHOME}/lib \
-L${II_SYSTEM}/ingres/lib \
-lingres \
-lMrm -lXm -lXt -lX11 -lF77 -lM77 \
-ll -ly -lm
# ========== libraries and headers ==========
MACHINE = SUN
LIB_DIR = .
OBJ_DIR = .
LIB = library.so
SOURCES = \
program_x.c \
programclilib.c \
programapplib.c
OBJECTS = \
program_x.o \
programclilib.o \
programapplib.o
$(LIB_DIR)/$(LIB): $(LIB_DIR)/$(LIB).1
rm -f $(LIB_DIR)/$(LIB); ln -s $(LIB_DIR)/$(LIB).1 $(LIB_DIR)/$(LIB)
$(LIB_DIR)/$(LIB).1: $(OBJECTS:%=$(OBJ_DIR)/%)
$(CC) -G -h $(LIB_DIR)/$(LIB).1 $? -o $(LIB_DIR)/$(LIB).1
$(OBJ_DIR)/%: $(SOURCES)
clean:
rm -f $(OBJECTS:%=$(OBJ_DIR)/%) $(LIB_DIR)/$(LIB) $(LIB_DIR)/$(LIB).1
If you already a sample Makefile for .so, please e-mail it to me if that's
not inconvenient for you.
Thanks,
Rana
--
--
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++