]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /*\r |
2 | * \r | |
3 | * Copyright 2001-2005 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 | |
17 | package net.sf.antcontrib.cpptasks.gcc;\r | |
18 | \r | |
19 | import java.io.File;\r | |
20 | import java.util.Vector;\r | |
21 | \r | |
22 | import net.sf.antcontrib.cpptasks.CUtil;\r | |
23 | import net.sf.antcontrib.cpptasks.compiler.CommandLineAssembler;\r | |
24 | import net.sf.antcontrib.cpptasks.compiler.LinkType;\r | |
25 | import net.sf.antcontrib.cpptasks.compiler.Linker;\r | |
26 | \r | |
27 | /**\r | |
28 | * Adapter for gcc assemble\r | |
29 | * \r | |
30 | */\r | |
31 | public final class GccAssembler extends CommandLineAssembler {\r | |
32 | private final static String[] sourceExtensions = new String[] { ".asm" };\r | |
33 | \r | |
34 | private final static String[] headerExtensions = new String[] { ".h",\r | |
35 | ".inc" };\r | |
36 | \r | |
37 | private static final GccAssembler instance = new GccAssembler("gas",\r | |
38 | sourceExtensions, headerExtensions, false);\r | |
39 | \r | |
40 | /**\r | |
41 | * Gets gcc adapter\r | |
42 | */\r | |
43 | public static GccAssembler getInstance() {\r | |
44 | return instance;\r | |
45 | }\r | |
46 | \r | |
47 | /**\r | |
48 | * Private constructor. Use GccAssembler.getInstance() to get singleton\r | |
49 | * instance of this class.\r | |
50 | */\r | |
51 | private GccAssembler (String command, String[] sourceExtensions,\r | |
52 | String[] headerExtensions, boolean isLibtool) {\r | |
53 | super(command, null, sourceExtensions, headerExtensions,\r | |
54 | isLibtool ? ".fo" : ".o");\r | |
55 | }\r | |
56 | \r | |
57 | public void addImpliedArgs(Vector args, boolean debug, Boolean defaultflag) {\r | |
58 | \r | |
59 | }\r | |
60 | \r | |
61 | public int getMaximumCommandLength() {\r | |
62 | return Integer.MAX_VALUE;\r | |
63 | }\r | |
64 | \r | |
65 | public Linker getLinker(LinkType linkType) {\r | |
66 | return GccLinker.getInstance().getLinker(linkType);\r | |
67 | }\r | |
68 | \r | |
69 | protected File[] getEnvironmentIncludePath() {\r | |
70 | return CUtil.getPathFromEnvironment("INCLUDE", ":");\r | |
71 | }\r | |
72 | \r | |
73 | protected String getIncludeDirSwitch(String includeDir) {\r | |
74 | return "-I" + includeDir;\r | |
75 | }\r | |
76 | }\r |