1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.github.maven_nar.cpptasks.arm;
21
22 import java.io.File;
23 import java.util.Vector;
24
25 import com.github.maven_nar.cpptasks.CUtil;
26 import com.github.maven_nar.cpptasks.compiler.CommandLineLinker;
27 import com.github.maven_nar.cpptasks.compiler.LinkType;
28 import com.github.maven_nar.cpptasks.compiler.Linker;
29 import com.github.maven_nar.cpptasks.types.LibraryTypeEnum;
30
31
32
33
34
35
36 public class ADSLinker extends CommandLineLinker {
37 private static final ADSLinker dllInstance = new ADSLinker(".o");
38 private static final ADSLinker instance = new ADSLinker(".axf");
39
40 public static ADSLinker getDllInstance() {
41 return dllInstance;
42 }
43
44 public static ADSLinker getInstance() {
45 return instance;
46 }
47
48 private ADSLinker(final String outputSuffix) {
49 super("armlink", "-vsn", new String[] {
50 ".o", ".lib", ".res"
51 }, new String[] {
52 ".map", ".pdb", ".lnk"
53 }, outputSuffix, false, null);
54 }
55
56 protected void addBase(final long base, final Vector<String> args) {
57
58 }
59
60 protected void addEntry(final String entry, final Vector<String> args) {
61
62
63 }
64
65 protected void addFixed(final Boolean fixed, final Vector<String> args) {
66
67 }
68
69 protected void addImpliedArgs(final boolean debug, final LinkType linkType, final Vector<String> args) {
70 if (debug) {
71 args.addElement("-debug");
72 }
73 }
74
75 protected void addIncremental(final boolean incremental, final Vector<String> args) {
76
77 }
78
79 protected void addMap(final boolean map, final Vector<String> args) {
80
81 }
82
83 protected void addStack(final int stack, final Vector<String> args) {
84
85 }
86
87
88
89
90
91
92 @Override
93 protected String getCommandFileSwitch(final String commandFile) {
94 return "-via" + commandFile;
95 }
96
97 @Override
98 public File[] getLibraryPath() {
99 return CUtil.getPathFromEnvironment("ARMLIB", ";");
100 }
101
102 @Override
103 public String[] getLibraryPatterns(final String[] libnames, final LibraryTypeEnum libType) {
104
105
106
107 return new String[] {
108 ".o"
109 };
110 }
111
112 @Override
113 public Linker getLinker(final LinkType linkType) {
114 return this;
115 }
116
117 @Override
118 protected int getMaximumCommandLength() {
119 return 1024;
120 }
121
122 @Override
123 protected String[] getOutputFileSwitch(final String outputFile) {
124 return new String[] {
125 "-output", outputFile
126 };
127 }
128
129 @Override
130 public boolean isCaseSensitive() {
131 return false;
132 }
133 }