]>
Commit | Line | Data |
---|---|---|
ca24c5ad RO |
1 | # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2011 |
2 | # Free Software Foundation, Inc. | |
ad41bd84 JM |
3 | # |
4 | # This file is part of GCC. | |
5 | # | |
6 | # GCC is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 3, or (at your option) | |
9 | # any later version. | |
10 | # | |
11 | # GCC is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with GCC; see the file COPYING3. If not see | |
18 | # <http://www.gnu.org/licenses/>. | |
19 | ||
ca24c5ad | 20 | # Build a shared libgcc library. |
aefa45d3 RH |
21 | |
22 | SHLIB_EXT = .so | |
2937267b | 23 | SHLIB_SOLINK = @shlib_base_name@.so |
ca24c5ad RO |
24 | SHLIB_SOVERSION = 1 |
25 | SHLIB_SONAME = @shlib_base_name@.so.$(SHLIB_SOVERSION) | |
72aad6e6 ZW |
26 | SHLIB_MAP = @shlib_map_file@ |
27 | SHLIB_OBJS = @shlib_objs@ | |
4e8d0554 | 28 | SHLIB_DIR = @multilib_dir@ |
2937267b | 29 | SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ |
ca24c5ad RO |
30 | SHLIB_LC = -lc |
31 | SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) | |
32 | SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \ | |
33 | $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) | |
72aad6e6 | 34 | |
ca24c5ad RO |
35 | SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ |
36 | $(SHLIB_LDFLAGS) \ | |
37 | -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \ | |
38 | $(SHLIB_OBJS) $(SHLIB_LC) && \ | |
4e8d0554 RS |
39 | rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ |
40 | if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \ | |
41 | mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \ | |
42 | $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \ | |
3b415018 | 43 | else true; fi && \ |
4e8d0554 | 44 | mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \ |
ca24c5ad | 45 | $(SHLIB_MAKE_SOLINK) |
2937267b | 46 | SHLIB_INSTALL = \ |
ca24c5ad | 47 | $(mkinstalldirs) $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ |
4e8d0554 | 48 | $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \ |
ca24c5ad RO |
49 | $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \ |
50 | rm -f $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ | |
51 | $(SHLIB_INSTALL_SOLINK) |