blob: bd2693c076040a818ad292dedbe9ae6101af7ab8 [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'o297f47a1997-04-26 14:25:20 +00008# ELF_SONAME = 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
34installdirs::
35 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ELF_INSTALL_DIR)
36
37install-shlibs install:: $(ELF_LIB) installdirs
38 $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
39 -ldconfig
40
41clean::
42 $(RM) -rf elfshared
43 $(RM) -f $(ELF_LIB)
44 $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so