]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLinker.java
3 * Copyright 2003-2004 The Ant-Contrib project
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package net
.sf
.antcontrib
.cpptasks
.arm
;
19 import java
.util
.Vector
;
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
;
28 * Adapter for the ARM Linker
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() {
38 public static ADSLinker
getInstance() {
41 private ADSLinker(String outputSuffix
) {
42 super("armlink", "-vsn", new String
[]{".o", ".lib", ".res"},
43 new String
[]{".map", ".pdb", ".lnk"}, outputSuffix
, false, null);
48 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addBase(long,
51 protected void addBase(long base
, Vector args
) {
52 // TODO Auto-generated method stub
57 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addFixed(java.lang.Boolean,
60 protected void addFixed(Boolean fixed
, Vector args
) {
61 // TODO Auto-generated method stub
66 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addImpliedArgs(boolean,
67 * net.sf.antcontrib.cpptasks.compiler.LinkType, java.util.Vector)
69 protected void addImpliedArgs(boolean debug
, LinkType linkType
, Vector args
, Boolean defaultflag
) {
71 args
.addElement("-debug");
77 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addIncremental(boolean,
80 protected void addIncremental(boolean incremental
, Vector args
) {
81 // TODO Auto-generated method stub
86 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addMap(boolean,
89 protected void addMap(boolean map
, Vector args
) {
90 // TODO Auto-generated method stub
95 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addStack(int,
98 protected void addStack(int stack
, Vector args
) {
99 // TODO Auto-generated method stub
102 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
104 protected void addEntry(String entry
, Vector args
) {
105 // TODO Auto-generated method stub
110 * May have to make this String array return
112 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getCommandFileSwitch(java.lang.String)
114 protected String
getCommandFileSwitch(String commandFile
) {
115 return "-via" + commandFile
;
120 * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPath()
122 public File
[] getLibraryPath() {
123 return CUtil
.getPathFromEnvironment("ARMLIB", ";");
126 * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPatterns(java.lang.String[])
128 public String
[] getLibraryPatterns(String
[] libnames
, LibraryTypeEnum libType
) {
130 // TODO: looks like bad extension
132 return new String
[]{".o"};
137 * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)
139 public Linker
getLinker(LinkType linkType
) {
145 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getMaximumCommandLength()
147 protected int getMaximumCommandLength() {
153 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getOutputFileSwitch(java.lang.String)
155 protected String
[] getOutputFileSwitch(String outputFile
) {
156 return new String
[]{"-output", outputFile
};
161 * @see net.sf.antcontrib.cpptasks.compiler.Linker#isCaseSensitive()
163 public boolean isCaseSensitive() {