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