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) |
| 12 | # |
| 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 | 297f47a | 1997-04-26 14:25:20 +0000 | [diff] [blame] | 27 | (cd elfshared; $(CC) --shared -o $(ELF_LIB) -Wl,-soname,$(ELF_SONAME) $(OBJS)) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 28 | $(MV) elfshared/$(ELF_LIB) . |
Theodore Ts'o | 297f47a | 1997-04-26 14:25:20 +0000 | [diff] [blame] | 29 | $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 30 | $(LN) $(ELF_LIB) ../$(ELF_LIB) |
| 31 | $(LN) ../$(ELF_LIB) ../$(ELF_IMAGE).so |
Theodore Ts'o | 297f47a | 1997-04-26 14:25:20 +0000 | [diff] [blame] | 32 | $(LN) ../$(ELF_LIB) ../$(ELF_SONAME) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 33 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 34 | installdirs-elf-lib:: |
| 35 | $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ELF_INSTALL_DIR) \ |
| 36 | $(DESTDIR)$(ulibdir) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 37 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 38 | installdirs:: installdirs-elf-lib |
| 39 | |
| 40 | install-shlibs install:: $(ELF_LIB) installdirs-elf-lib |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 41 | $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 42 | $(STRIP) --strip-debug \ |
| 43 | $(DESTDIR)$(DLL_INSTALL_DIR)/$(ELF_LIB) |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 44 | $(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'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 47 | -ldconfig |
| 48 | |
| 49 | clean:: |
| 50 | $(RM) -rf elfshared |
| 51 | $(RM) -f $(ELF_LIB) |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 52 | $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME) |