blob: ff19bc91a2615b8005b5f13638dccb9eb929b63b [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001#
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
Theodore Ts'o74becf31997-04-26 14:37:06 +00008# ELF_SO_VERSION = 1
Theodore Ts'o50e1e101997-04-26 13:58:21 +00009# ELF_IMAGE = libce
10# ELF_MYDIR = et
11# ELF_INSTALL_DIR = $(SHLIBDIR)
12#
13
14all:: elfshared image
15
16subdirs:: elfshared
17
18elfshared:
19 mkdir elfshared
20
21ELF_LIB = $(ELF_IMAGE).so.$(ELF_VERSION)
Theodore Ts'o297f47a1997-04-26 14:25:20 +000022ELF_SONAME = $(ELF_IMAGE).so.$(ELF_SO_VERSION)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000023
24image: $(ELF_LIB)
25
26$(ELF_LIB): $(OBJS)
Theodore Ts'o297f47a1997-04-26 14:25:20 +000027 (cd elfshared; $(CC) --shared -o $(ELF_LIB) -Wl,-soname,$(ELF_SONAME) $(OBJS))
Theodore Ts'o50e1e101997-04-26 13:58:21 +000028 $(MV) elfshared/$(ELF_LIB) .
Theodore Ts'o297f47a1997-04-26 14:25:20 +000029 $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000030 $(LN) $(ELF_LIB) ../$(ELF_LIB)
31 $(LN) ../$(ELF_LIB) ../$(ELF_IMAGE).so
Theodore Ts'o297f47a1997-04-26 14:25:20 +000032 $(LN) ../$(ELF_LIB) ../$(ELF_SONAME)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000033
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000034installdirs-elf-lib::
35 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ELF_INSTALL_DIR) \
36 $(DESTDIR)$(ulibdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000037
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000038installdirs:: installdirs-elf-lib
39
40install-shlibs install:: $(ELF_LIB) installdirs-elf-lib
Theodore Ts'o50e1e101997-04-26 13:58:21 +000041 $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
Theodore Ts'o74becf31997-04-26 14:37:06 +000042 $(STRIP) --strip-debug \
43 $(DESTDIR)$(DLL_INSTALL_DIR)/$(ELF_LIB)
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000044 $(LN_S) -f $(ELF_LIB) $(DESTDIR)$(DLL_INSTALL_DIR)/$(ELF_SONAME)
45 $(LN_S) -f $(DLL_INSTALL_DIR)/$(ELF_SONAME) \
46 $(DESTDIR)$(ulibdir)/$(ELF_IMAGE).so
Theodore Ts'o50e1e101997-04-26 13:58:21 +000047 -ldconfig
48
49clean::
50 $(RM) -rf elfshared
51 $(RM) -f $(ELF_LIB)
Theodore Ts'o62c06f71997-04-29 14:34:47 +000052 $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)