]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLinker.java
Initial import.
[mirror_edk2.git] / Tools / Source / Cpptasks / net / sf / antcontrib / cpptasks / ti / ClxxLinker.java
CommitLineData
878ddf1f 1/*\r
2 * \r
3 * Copyright 2001-2004 The Ant-Contrib project\r
4 *\r
5 * Licensed under the Apache License, Version 2.0 (the "License");\r
6 * you may not use this file except in compliance with the License.\r
7 * You may obtain a copy of the License at\r
8 *\r
9 * http://www.apache.org/licenses/LICENSE-2.0\r
10 *\r
11 * Unless required by applicable law or agreed to in writing, software\r
12 * distributed under the License is distributed on an "AS IS" BASIS,\r
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14 * See the License for the specific language governing permissions and\r
15 * limitations under the License.\r
16 */\r
17package net.sf.antcontrib.cpptasks.ti;\r
18import java.io.File;\r
19import java.util.Vector;\r
20\r
21import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;\r
22import net.sf.antcontrib.cpptasks.compiler.LinkType;\r
23import net.sf.antcontrib.cpptasks.compiler.Linker;\r
24import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;\r
25\r
26/**\r
27 * Adapter for TI DSP linkers\r
28 * *\r
29 * @author CurtA\r
30 * \r
31 */\r
32public class ClxxLinker extends CommandLineLinker {\r
33 private static final ClxxLinker cl55DllInstance = new ClxxLinker("lnk55",\r
34 ".dll");\r
35 private static final ClxxLinker cl55Instance = new ClxxLinker("lnk55",\r
36 ".exe");\r
37 private static final ClxxLinker cl6xDllInstance = new ClxxLinker("lnk6x",\r
38 ".dll");\r
39 private static final ClxxLinker cl6xInstance = new ClxxLinker("lnk6x",\r
40 ".exe");\r
41 public static ClxxLinker getCl55DllInstance() {\r
42 return cl55DllInstance;\r
43 }\r
44 public static ClxxLinker getCl55Instance() {\r
45 return cl55Instance;\r
46 }\r
47 public static ClxxLinker getCl6xDllInstance() {\r
48 return cl6xDllInstance;\r
49 }\r
50 public static ClxxLinker getCl6xInstance() {\r
51 return cl6xInstance;\r
52 }\r
53 private ClxxLinker(String command, String outputSuffix) {\r
54 super(command, "-h", new String[]{".o", ".lib", ".res"}, new String[]{\r
55 ".map", ".pdb", ".lnk"}, outputSuffix, false, null);\r
56 }\r
57 /*\r
58 * (non-Javadoc)\r
59 * \r
60 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addBase(long,\r
61 * java.util.Vector)\r
62 */\r
63 protected void addBase(long base, Vector args) {\r
64 }\r
65 /*\r
66 * (non-Javadoc)\r
67 * \r
68 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addFixed(java.lang.Boolean,\r
69 * java.util.Vector)\r
70 */\r
71 protected void addFixed(Boolean fixed, Vector args) {\r
72 }\r
73 /*\r
74 * (non-Javadoc)\r
75 * \r
76 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addImpliedArgs(boolean,\r
77 * net.sf.antcontrib.cpptasks.compiler.LinkType, java.util.Vector)\r
78 */\r
79 protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {\r
80 if (linkType.isSharedLibrary()) {\r
81 args.addElement("-abs");\r
82 }\r
83 }\r
84 /*\r
85 * (non-Javadoc)\r
86 * \r
87 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addIncremental(boolean,\r
88 * java.util.Vector)\r
89 */\r
90 protected void addIncremental(boolean incremental, Vector args) {\r
91 }\r
92 /*\r
93 * (non-Javadoc)\r
94 * \r
95 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addMap(boolean,\r
96 * java.util.Vector)\r
97 */\r
98 protected void addMap(boolean map, Vector args) {\r
99 if (map) {\r
100 args.addElement("-m");\r
101 }\r
102 }\r
103 /*\r
104 * (non-Javadoc)\r
105 * \r
106 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addStack(int,\r
107 * java.util.Vector)\r
108 */\r
109 protected void addStack(int stack, Vector args) {\r
110 }\r
111 /* (non-Javadoc)\r
112 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)\r
113 */\r
114 protected void addEntry(String entry, Vector args) {\r
115 }\r
116 \r
117 /*\r
118 * (non-Javadoc)\r
119 * \r
120 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getCommandFileSwitch(java.lang.String)\r
121 */\r
122 protected String getCommandFileSwitch(String commandFile) {\r
123 return "@" + commandFile;\r
124 }\r
125 /*\r
126 * (non-Javadoc)\r
127 * \r
128 * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPath()\r
129 */\r
130 public File[] getLibraryPath() {\r
131 return new File[0];\r
132 }\r
133 /*\r
134 * (non-Javadoc)\r
135 * \r
136 * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPatterns(java.lang.String[])\r
137 */\r
138 public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {\r
139 //\r
140 // TODO: Looks bogus, should be .a or .so's not .o's\r
141 //\r
142 String[] libpats = new String[libnames.length];\r
143 for (int i = 0; i < libnames.length; i++) {\r
144 libpats[i] = libnames[i] + ".o";\r
145 }\r
146 return libpats;\r
147 }\r
148 /*\r
149 * (non-Javadoc)\r
150 * \r
151 * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)\r
152 */\r
153 public Linker getLinker(LinkType linkType) {\r
154 return this;\r
155 }\r
156 /*\r
157 * (non-Javadoc)\r
158 * \r
159 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getMaximumCommandLength()\r
160 */\r
161 protected int getMaximumCommandLength() {\r
162 return 1024;\r
163 }\r
164 /*\r
165 * (non-Javadoc)\r
166 * \r
167 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getOutputFileSwitch(java.lang.String)\r
168 */\r
169 protected String[] getOutputFileSwitch(String outputFile) {\r
170 return new String[]{"-o", outputFile};\r
171 }\r
172 /*\r
173 * (non-Javadoc)\r
174 * \r
175 * @see net.sf.antcontrib.cpptasks.compiler.Linker#isCaseSensitive()\r
176 */\r
177 public boolean isCaseSensitive() {\r
178 // TODO Auto-generated method stub\r
179 return false;\r
180 }\r
181}\r