2000-10-25 06:38:39 +04:00
|
|
|
#
|
|
|
|
# This is a Makefile stub which handles the creation of Linux ELF shared
|
|
|
|
# libraries.
|
|
|
|
#
|
|
|
|
# In order to use this stub, the following makefile variables must be defined.
|
|
|
|
#
|
|
|
|
# ELF_VERSION = 1.0
|
|
|
|
# ELF_SO_VERSION = 1
|
|
|
|
# ELF_IMAGE = libce
|
|
|
|
# ELF_MYDIR = et
|
|
|
|
# ELF_INSTALL_DIR = $(SHLIBDIR)
|
|
|
|
# ELF_OTHER_LIBS = -lc
|
|
|
|
|
2008-01-02 00:48:09 +03:00
|
|
|
all:: image
|
2000-10-25 06:38:39 +04:00
|
|
|
|
2006-03-11 05:39:40 +03:00
|
|
|
real-subdirs:: Makefile
|
2009-07-02 08:11:17 +04:00
|
|
|
$(E) " MKDIR elfshared"
|
|
|
|
$(Q) mkdir -p elfshared
|
2000-10-25 06:38:39 +04:00
|
|
|
|
|
|
|
ELF_LIB = $(ELF_IMAGE).so.$(ELF_VERSION)
|
|
|
|
ELF_SONAME = $(ELF_IMAGE).so.$(ELF_SO_VERSION)
|
|
|
|
|
|
|
|
image: $(ELF_LIB)
|
|
|
|
|
|
|
|
$(ELF_LIB): $(OBJS)
|
2009-07-02 08:11:17 +04:00
|
|
|
$(E) " GEN_ELF_SOLIB $(ELF_LIB)"
|
|
|
|
$(Q) (cd elfshared; $(CC) --shared -o $(ELF_LIB) $(LDFLAGS) \
|
2005-12-11 06:33:25 +03:00
|
|
|
-Wl,-h,$(ELF_SONAME) $(OBJS) $(ELF_OTHER_LIBS))
|
2009-07-02 08:11:17 +04:00
|
|
|
$(Q) $(MV) elfshared/$(ELF_LIB) .
|
|
|
|
$(Q) $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
|
2010-05-18 03:21:42 +04:00
|
|
|
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
|
|
|
|
`echo $(my_dir) | sed -e 's;lib/;;'`/$(ELF_LIB) $(ELF_LIB))
|
|
|
|
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_IMAGE).so)
|
|
|
|
$(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_SONAME))
|
2000-10-25 06:38:39 +04:00
|
|
|
|
|
|
|
installdirs-elf-lib::
|
2004-12-15 05:46:26 +03:00
|
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(ELF_INSTALL_DIR) \
|
2000-10-25 06:38:39 +04:00
|
|
|
$(DESTDIR)$(libdir)
|
|
|
|
|
|
|
|
installdirs:: installdirs-elf-lib
|
|
|
|
|
|
|
|
install-shlibs install:: $(ELF_LIB) installdirs-elf-lib
|
|
|
|
$(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
|
|
|
|
$(LN_S) -f $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME)
|
|
|
|
$(LN_S) -f $(ELF_INSTALL_DIR)/$(ELF_SONAME) \
|
|
|
|
$(DESTDIR)$(libdir)/$(ELF_IMAGE).so
|
2001-05-20 02:07:36 +04:00
|
|
|
-$(LDCONFIG)
|
2000-10-25 06:38:39 +04:00
|
|
|
|
2004-12-15 19:28:55 +03:00
|
|
|
install-strip: install
|
|
|
|
$(STRIP) -x $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
|
|
|
|
|
|
|
|
install-shlibs-strip: install-shlibs
|
|
|
|
$(STRIP) -x $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
|
|
|
|
|
2000-10-25 06:38:39 +04:00
|
|
|
uninstall-shlibs uninstall::
|
|
|
|
$(RM) -f $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) \
|
|
|
|
$(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) \
|
|
|
|
$(DESTDIR)$(libdir)/$(ELF_IMAGE).so
|
2001-05-20 02:07:36 +04:00
|
|
|
-$(LDCONFIG)
|
2000-10-25 06:38:39 +04:00
|
|
|
|
|
|
|
clean::
|
|
|
|
$(RM) -rf elfshared
|
|
|
|
$(RM) -f $(ELF_LIB)
|
|
|
|
$(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
|