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