blob: 4804d486675e709647db4ded1c3c81f75330c97e [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)
Theodore Ts'o21c84b71997-04-29 16:15:03 +000012# ELF_OTHER_LIBS = -lc
Theodore Ts'o50e1e101997-04-26 13:58:21 +000013
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'o21c84b71997-04-29 16:15:03 +000027 (cd elfshared; $(CC) --shared -o $(ELF_LIB) -Wl,-soname,$(ELF_SONAME) \
28 $(OBJS) $(ELF_OTHER_LIBS))
Theodore Ts'o50e1e101997-04-26 13:58:21 +000029 $(MV) elfshared/$(ELF_LIB) .
Theodore Ts'o297f47a1997-04-26 14:25:20 +000030 $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000031 $(LN) $(ELF_LIB) ../$(ELF_LIB)
32 $(LN) ../$(ELF_LIB) ../$(ELF_IMAGE).so
Theodore Ts'o297f47a1997-04-26 14:25:20 +000033 $(LN) ../$(ELF_LIB) ../$(ELF_SONAME)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000034
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000035installdirs-elf-lib::
36 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ELF_INSTALL_DIR) \
37 $(DESTDIR)$(ulibdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000038
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000039installdirs:: installdirs-elf-lib
40
41install-shlibs install:: $(ELF_LIB) installdirs-elf-lib
Theodore Ts'o50e1e101997-04-26 13:58:21 +000042 $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
Theodore Ts'o74becf31997-04-26 14:37:06 +000043 $(STRIP) --strip-debug \
44 $(DESTDIR)$(DLL_INSTALL_DIR)/$(ELF_LIB)
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000045 $(LN_S) -f $(ELF_LIB) $(DESTDIR)$(DLL_INSTALL_DIR)/$(ELF_SONAME)
46 $(LN_S) -f $(DLL_INSTALL_DIR)/$(ELF_SONAME) \
47 $(DESTDIR)$(ulibdir)/$(ELF_IMAGE).so
Theodore Ts'o50e1e101997-04-26 13:58:21 +000048 -ldconfig
49
50clean::
51 $(RM) -rf elfshared
52 $(RM) -f $(ELF_LIB)
Theodore Ts'o62c06f71997-04-29 14:34:47 +000053 $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)