]> git.sur5r.net Git - openldap/blob - build/lib-shared.mk
Cleanup while loops in dn2id_add/delete
[openldap] / build / lib-shared.mk
1 # $OpenLDAP$
2 ## Copyright 1998-2002 The OpenLDAP Foundation
3 ## COPYING RESTRICTIONS APPLY.  See COPYRIGHT File in top level directory
4 ## of this package for details.
5 ##---------------------------------------------------------------------------
6 ##
7 ## Makefile Template for Shared Libraries
8 ##
9
10 MKDEPFLAG = -l
11
12 .SUFFIXES: .c .o .lo
13
14 .c.lo:
15         $(LTCOMPILE_LIB) $<
16
17 #
18 # symlinks for libraries: UNIX and Windows (a.k.a. NT) need to be handled
19 # differently. In UNIX, the static and shared libraries, as well as shared
20 # library symlinks, can all be symlinked in the 'libraries' directory. In
21 # Windows, only the static library (.a file) or the shared library (.dll)
22 # file should be present. The current mingw linker (i.e. ld) WILL look
23 # for a .dll file at link time and internally generate an import library
24 # for it. However, ld will not do this if a static library is present.
25 # That doesn't seem very correct, but that's the behavior, like it or not.
26 #
27 # Note that there doesn't seem to be a true need for the .la file at
28 # this level, so it is left out.
29 #
30 # The set of symlinks are determined by examining the library's .la file.
31 #
32 $(LIBRARY): version.lo
33         $(LTLINK_LIB) -o $@ $(OBJS) version.lo $(LINK_LIBS)
34         @d=`$(PWD)`; b=`$(BASENAME) $$d`; \
35         echo cd ..; \
36         cd ..; \
37         arlib=`grep '^old_library=' $$b/$@`; \
38         arlib=`expr "$$arlib" : "[^']*'\(.*\)'"`; \
39         libs=$$arlib; \
40         if test "$(BUILD_LIBS_DYNAMIC)" = "shared"; then \
41                 shlibs=`grep '^library_names' $$b/$@`; \
42                 shlibs=`expr "$$shlibs" : "[^']*'\(.*\)'"`; \
43                 libs="$$libs $$shlibs"; \
44         fi; \
45         for i in $$libs; do \
46                 echo $(RM) $$i; \
47                 $(RM) $$i; \
48                 echo $(LN_S) $$b/.libs/$$i $$i; \
49                 $(LN_S) $$b/.libs/$$i $$i; \
50         done
51
52 Makefile: $(top_srcdir)/build/lib-shared.mk
53