blob: e755d20c68cd42afea86b936e1fc6ecc3bceda4a [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) \
Theodore Ts'o39b50341998-04-01 02:51:21 +000037 $(DESTDIR)$(libdir)
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 \
Theodore Ts'o17dba281998-03-30 01:16:26 +000044 $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
45 $(LN_S) -f $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME)
46 $(LN_S) -f $(ELF_INSTALL_DIR)/$(ELF_SONAME) \
Theodore Ts'o39b50341998-04-01 02:51:21 +000047 $(DESTDIR)$(libdir)/$(ELF_IMAGE).so
48 -ldconfig
49
50uninstall-shlibs uninstall::
51 $(RM) -f $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) \
52 $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) \
53 $(DESTDIR)$(libdir)/$(ELF_IMAGE).so
Theodore Ts'o50e1e101997-04-26 13:58:21 +000054 -ldconfig
55
56clean::
57 $(RM) -rf elfshared
58 $(RM) -f $(ELF_LIB)
Theodore Ts'o62c06f71997-04-29 14:34:47 +000059 $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)