Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 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 |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 8 | # ELF_SO_VERSION = 1 |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 9 | # ELF_IMAGE = libce |
| 10 | # ELF_MYDIR = et |
| 11 | # ELF_INSTALL_DIR = $(SHLIBDIR) |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 12 | # ELF_OTHER_LIBS = -lc |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 13 | |
| 14 | all:: elfshared image |
| 15 | |
| 16 | subdirs:: elfshared |
| 17 | |
| 18 | elfshared: |
| 19 | mkdir elfshared |
| 20 | |
| 21 | ELF_LIB = $(ELF_IMAGE).so.$(ELF_VERSION) |
Theodore Ts'o | 297f47a | 1997-04-26 14:25:20 +0000 | [diff] [blame] | 22 | ELF_SONAME = $(ELF_IMAGE).so.$(ELF_SO_VERSION) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 23 | |
| 24 | image: $(ELF_LIB) |
| 25 | |
| 26 | $(ELF_LIB): $(OBJS) |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 27 | (cd elfshared; $(CC) --shared -o $(ELF_LIB) -Wl,-soname,$(ELF_SONAME) \ |
| 28 | $(OBJS) $(ELF_OTHER_LIBS)) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 29 | $(MV) elfshared/$(ELF_LIB) . |
Theodore Ts'o | 297f47a | 1997-04-26 14:25:20 +0000 | [diff] [blame] | 30 | $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 31 | $(LN) $(ELF_LIB) ../$(ELF_LIB) |
| 32 | $(LN) ../$(ELF_LIB) ../$(ELF_IMAGE).so |
Theodore Ts'o | 297f47a | 1997-04-26 14:25:20 +0000 | [diff] [blame] | 33 | $(LN) ../$(ELF_LIB) ../$(ELF_SONAME) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 34 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 35 | installdirs-elf-lib:: |
| 36 | $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ELF_INSTALL_DIR) \ |
| 37 | $(DESTDIR)$(ulibdir) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 38 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 39 | installdirs:: installdirs-elf-lib |
| 40 | |
| 41 | install-shlibs install:: $(ELF_LIB) installdirs-elf-lib |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 42 | $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 43 | $(STRIP) --strip-debug \ |
Theodore Ts'o | 17dba28 | 1998-03-30 01:16:26 +0000 | [diff] [blame] | 44 | $(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'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 47 | $(DESTDIR)$(ulibdir)/$(ELF_IMAGE).so |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 48 | -ldconfig |
| 49 | |
| 50 | clean:: |
| 51 | $(RM) -rf elfshared |
| 52 | $(RM) -f $(ELF_LIB) |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 53 | $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME) |