Whamcloud - gitweb
Many files:
[tools/e2fsprogs.git] / lib / Makefile.elf-lib
1 #
2 # This is a Makefile stub which handles the creation of Linux ELF shared
3 # libraries.
4 #
5 # In order to use this stub, the following makefile variables must be defined.
6
7 # ELF_VERSION = 1.0
8 # ELF_SONAME = 1
9 # ELF_IMAGE = libce
10 # ELF_MYDIR = et
11 # ELF_INSTALL_DIR = $(SHLIBDIR)
12 #
13
14 all:: elfshared image
15
16 subdirs:: elfshared
17
18 elfshared:
19         mkdir elfshared
20
21 ELF_LIB = $(ELF_IMAGE).so.$(ELF_VERSION)
22 ELF_SONAME = $(ELF_IMAGE).so.$(ELF_SO_VERSION)
23
24 image:          $(ELF_LIB)
25
26 $(ELF_LIB): $(OBJS)
27         (cd elfshared; $(CC) --shared -o $(ELF_LIB) -Wl,-soname,$(ELF_SONAME) $(OBJS))
28         $(MV) elfshared/$(ELF_LIB) .
29         $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
30         $(LN) $(ELF_LIB) ../$(ELF_LIB)
31         $(LN) ../$(ELF_LIB) ../$(ELF_IMAGE).so
32         $(LN) ../$(ELF_LIB) ../$(ELF_SONAME)
33
34 installdirs::
35         $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ELF_INSTALL_DIR)
36
37 install-shlibs install:: $(ELF_LIB) installdirs
38         $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
39         -ldconfig
40
41 clean::
42         $(RM) -rf elfshared
43         $(RM) -f $(ELF_LIB)
44         $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so