2 # This is a Makefile stub which handles the creation of Linux ELF shared
5 # In order to use this stub, the following makefile variables must be defined.
11 # ELF_INSTALL_DIR = $(SHLIBDIR)
12 # ELF_OTHER_LIBS = -lc
16 real-subdirs:: Makefile
17 $(E) " MKDIR elfshared"
18 $(Q) mkdir -p elfshared
20 ELF_LIB = $(ELF_IMAGE).so.$(ELF_VERSION)
21 ELF_SONAME = $(ELF_IMAGE).so.$(ELF_SO_VERSION)
26 $(E) " GEN_ELF_SOLIB $(ELF_LIB)"
27 $(Q) (cd elfshared; $(CC) -o $(ELF_LIB) \
28 -L$(top_builddir)/../lib $(LDFLAGS_SHLIB) -fPIC -shared \
29 -Wl,-soname,$(ELF_SONAME) $(OBJS) $(ELF_OTHER_LIBS))
30 $(Q) $(MV) elfshared/$(ELF_LIB) .
31 $(Q) $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
32 $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \
33 `echo $(my_dir) | sed -e 's;lib/;;'`/$(ELF_LIB) $(ELF_LIB))
34 $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_IMAGE).so)
35 $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_SONAME))
38 $(E) " MKDIR_P $(ELF_INSTALL_DIR) $(libdir)"
39 $(Q) $(MKDIR_P) $(DESTDIR)$(ELF_INSTALL_DIR) \
42 installdirs:: installdirs-elf-lib
44 install-shlibs install:: $(ELF_LIB) installdirs-elf-lib $(DEP_INSTALL_SYMLINK)
45 $(E) " INSTALL-ELF-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)"
46 $(Q) $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
47 $(E) " SYMLINK $(ELF_INSTALL_DIR)/$(ELF_SONAME)"
48 $(Q) $(INSTALL_SYMLINK) $(ELF_INSTALL_DIR)/$(ELF_LIB) \
49 $(ELF_INSTALL_DIR)/$(ELF_SONAME) $(DESTDIR)
50 $(E) " SYMLINK $(libdir)/$(ELF_IMAGE).so"
51 $(Q) $(INSTALL_SYMLINK) $(ELF_INSTALL_DIR)/$(ELF_SONAME) \
52 $(libdir)/$(ELF_IMAGE).so $(DESTDIR)
56 install-strip: install
57 $(E) " STRIP-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)"
58 $(Q) $(STRIP) --strip-unneeded --remove-section=.comment \
59 --remove-section=.note $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
61 install-shlibs-strip:: install-shlibs
62 $(E) " STRIP-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)"
63 $(Q) $(STRIP) --strip-unneeded --remove-section=.comment \
64 --remove-section=.note $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
66 uninstall-shlibs uninstall::
67 $(RM) -f $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) \
68 $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) \
69 $(DESTDIR)$(libdir)/$(ELF_IMAGE).so
75 $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)