]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLinker.java
Initial import.
[mirror_edk2.git] / Tools / Source / Cpptasks / net / sf / antcontrib / cpptasks / arm / ADSLinker.java
CommitLineData
878ddf1f 1/*\r
2 * \r
3 * Copyright 2003-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.arm;\r
18import java.io.File;\r
19import java.util.Vector;\r
20\r
21import net.sf.antcontrib.cpptasks.CUtil;\r
22import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;\r
23import net.sf.antcontrib.cpptasks.compiler.LinkType;\r
24import net.sf.antcontrib.cpptasks.compiler.Linker;\r
25import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;\r
26\r
27/**\r
28 * Adapter for the ARM Linker\r
29 * \r
30 * @author CurtA\r
31 */\r
32public class ADSLinker extends CommandLineLinker {\r
33 private static final ADSLinker dllInstance = new ADSLinker(".o");\r
34 private static final ADSLinker instance = new ADSLinker(".axf");\r
35 public static ADSLinker getDllInstance() {\r
36 return dllInstance;\r
37 }\r
38 public static ADSLinker getInstance() {\r
39 return instance;\r
40 }\r
41 private ADSLinker(String outputSuffix) {\r
42 super("armlink", "-vsn", new String[]{".o", ".lib", ".res"},\r
43 new String[]{".map", ".pdb", ".lnk"}, outputSuffix, false, null);\r
44 }\r
45 /*\r
46 * (non-Javadoc)\r
47 * \r
48 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addBase(long,\r
49 * java.util.Vector)\r
50 */\r
51 protected void addBase(long base, Vector args) {\r
52 // TODO Auto-generated method stub\r
53 }\r
54 /*\r
55 * (non-Javadoc)\r
56 * \r
57 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addFixed(java.lang.Boolean,\r
58 * java.util.Vector)\r
59 */\r
60 protected void addFixed(Boolean fixed, Vector args) {\r
61 // TODO Auto-generated method stub\r
62 }\r
63 /*\r
64 * (non-Javadoc)\r
65 * \r
66 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addImpliedArgs(boolean,\r
67 * net.sf.antcontrib.cpptasks.compiler.LinkType, java.util.Vector)\r
68 */\r
69 protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {\r
70 if (debug) {\r
71 args.addElement("-debug");\r
72 }\r
73 }\r
74 /*\r
75 * (non-Javadoc)\r
76 * \r
77 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addIncremental(boolean,\r
78 * java.util.Vector)\r
79 */\r
80 protected void addIncremental(boolean incremental, Vector args) {\r
81 // TODO Auto-generated method stub\r
82 }\r
83 /*\r
84 * (non-Javadoc)\r
85 * \r
86 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addMap(boolean,\r
87 * java.util.Vector)\r
88 */\r
89 protected void addMap(boolean map, Vector args) {\r
90 // TODO Auto-generated method stub\r
91 }\r
92 /*\r
93 * (non-Javadoc)\r
94 * \r
95 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addStack(int,\r
96 * java.util.Vector)\r
97 */\r
98 protected void addStack(int stack, Vector args) {\r
99 // TODO Auto-generated method stub\r
100 }\r
101 /* (non-Javadoc)\r
102 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)\r
103 */\r
104 protected void addEntry(String entry, Vector args) {\r
105 // TODO Auto-generated method stub\r
106\r
107 }\r
108 \r
109 /**\r
110 * May have to make this String array return\r
111 * \r
112 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getCommandFileSwitch(java.lang.String)\r
113 */\r
114 protected String getCommandFileSwitch(String commandFile) {\r
115 return "-via" + commandFile;\r
116 }\r
117 /*\r
118 * (non-Javadoc)\r
119 * \r
120 * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPath()\r
121 */\r
122 public File[] getLibraryPath() {\r
123 return CUtil.getPathFromEnvironment("ARMLIB", ";");\r
124 }\r
125 /*\r
126 * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPatterns(java.lang.String[])\r
127 */\r
128 public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {\r
129 //\r
130 // TODO: looks like bad extension\r
131 //\r
132 return new String[]{".o"};\r
133 }\r
134 /*\r
135 * (non-Javadoc)\r
136 * \r
137 * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)\r
138 */\r
139 public Linker getLinker(LinkType linkType) {\r
140 return this;\r
141 }\r
142 /*\r
143 * (non-Javadoc)\r
144 * \r
145 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getMaximumCommandLength()\r
146 */\r
147 protected int getMaximumCommandLength() {\r
148 return 1024;\r
149 }\r
150 /*\r
151 * (non-Javadoc)\r
152 * \r
153 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getOutputFileSwitch(java.lang.String)\r
154 */\r
155 protected String[] getOutputFileSwitch(String outputFile) {\r
156 return new String[]{"-output", outputFile};\r
157 }\r
158 /*\r
159 * (non-Javadoc)\r
160 * \r
161 * @see net.sf.antcontrib.cpptasks.compiler.Linker#isCaseSensitive()\r
162 */\r
163 public boolean isCaseSensitive() {\r
164 return false;\r
165 }\r
166}\r