source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include_mkf/mkf_linker.info @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 2.6 KB
Line 
1#    This file is part of MKF.
2#
3#    MKF is free software; you can redistribute it and/or modify
4#    it under the terms of the GNU General Public License as published by
5#    the Free Software Foundation; either version 2 of the License, or
6#    (at your option) any later version.
7#
8#    MKF is distributed in the hope that it will be useful,
9#    but WITHOUT ANY WARRANTY; without even the implied warranty of
10#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11#    GNU General Public License for more details.
12#
13#    You should have received a copy of the GNU General Public License
14#    along with MKF; if not, write to the Free Software
15#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16#
17#    Copyright (c) 2004 Alexandre Becoulet <alexandre.becoulet@epita.fr>
18
19# static lib archiver invocation
20_if_var_eq              cmd_linker
21 var_define             cmd_linker      ld
22_end_if
23
24_if_var_eq              use_linker
25
26 _if_in_path            {PVAR,cmd_linker}
27
28  _if_stdout_match      GNU     {PVAR,cmd_linker} -V
29   msg_info             GNU linker found ({PVAR,cmd_linker})
30   var_define           use_linker      gnu
31  _else
32
33   _if_stdout_match     Solaris {PVAR,cmd_linker} -V
34    msg_info            Solaris linker found ({PVAR,cmd_linker})
35    var_define          use_linker      solaris
36   _else
37
38    msg_info            unknown linker found ({PVAR,cmd_linker})
39    var_define          use_linker      ld
40   _end_if
41  _end_if
42
43 _else
44  msg_error             no linker found
45 _end_if
46
47_end_if
48
49# object merge link
50
51_if_var_eq              mkf_pretty_print        yes
52 command_add            o       o       @echo "   LD (partial .o)   {OUT}"
53_end_if
54command_add             o       o       {PVAR,cmd_linker} -r {JVAR,opt_o_linker} -o {OUT} {SRC,.*\.o}
55
56# dynamic lib linker invocation
57_if_var_eq              use_linker      solaris
58 msg_info               using ld -G for dynamic library generation
59 var_append             opt_so_linker   -G
60_else
61 msg_info               using ld -shared for dynamic library generation
62 var_append             opt_so_linker   -shared
63_end_if
64
65_if_var_eq              static          yes
66 var_append             opt_exe_linker  -static
67_end_if
68
69_if_var_eq              mkf_pretty_print        yes
70 command_add            o       so      @echo "   LD (shared .so)   {OUT}"
71_end_if
72command_add             o       so      {PVAR,cmd_linker} {JVAR,opt_so_linker} -o {OUT} {SRC,.*\.o} {JLIST,-l,_libs} {JLIST,-l,libs}
73
74_if_var_eq              mkf_pretty_print        yes
75 command_add            o       noext   @echo "   CC (exe linking)  {OUT}"
76_end_if
77command_add             o       noext   {JVAR,cmd_c_compiler} {JVAR,opt_exe_linker} \
78                                        -o {OUT} {SRC,.*\.o} {JLIST,-L,lib_dirs} {JLIST,-l,_libs} {JLIST,-l,libs}
79
80_if_var_eq              mkf_pretty_print        yes
81 command_add            o       a       @echo "   AR                {OUT}"
82_end_if
83command_add             o       a       ar -rc {OUT} {SRC,.*\.o}
84
85_if_var_eq              mkf_pretty_print        yes
86 command_add            o       a       @echo "   RANLIB            {OUT}"
87_end_if
88command_add             o       a       ranlib {OUT}
89
Note: See TracBrowser for help on using the repository browser.