blob: 7d45944059840fc5576011f98d06ee0712586647 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
/*
* Copyright (c) 2008
* Embedded Brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* rtems@embedded-brains.de
*
* The license and distribution terms for this file may be found in the file
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
*/
package org.rtems.cdt;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
public class Activator extends AbstractUIPlugin {
private static Activator mPlugin;
public void start( BundleContext context) throws Exception {
super.start( context);
mPlugin = this;
createBSPInfoMakefile();
}
public void stop( BundleContext context) throws Exception {
mPlugin = null;
super.stop( context);
}
public static Activator getDefault() {
return mPlugin;
}
public IPath getMakefileLocation() {
return getStateLocation();
}
private void createBSPInfoMakefile() {
IPath makefile = getMakefileLocation().append( "Makefile");
BufferedWriter out = null;
try {
out = new BufferedWriter( new FileWriter( makefile.toFile()));
out.write(
"include $(" + Constants.BSP_PATH_MAKE_VARIABLE + ")/Makefile.inc\n"
+ "include $(RTEMS_CUSTOM)\n"
+ "include $(PROJECT_ROOT)/make/leaf.cfg\n"
+ "all:\n"
+ "\t@echo " + Constants.TOOL_ARCHIVER_KEY + "\n"
+ "\t@for i in $(AR) ; do printf \"\\t%s\\n\" \"$$i\" ; done\n"
+ "\t@echo " + Constants.TOOL_ASSEMBLER_KEY + "\n"
+ "\t@for i in $(AS) ; do printf \"\\t%s\\n\" \"$$i\" ; done\n"
+ "\t@echo " + Constants.TOOL_COMPILER_C_KEY + "\n"
+ "\t@for i in $(COMPILE.c) ; do printf \"\\t%s\\n\" \"$$i\" ; done\n"
+ "\t@echo " + Constants.TOOL_COMPILER_CPP_KEY + "\n"
+ "\t@for i in $(COMPILE.cc) ; do printf \"\\t%s\\n\" \"$$i\" ; done\n"
+ "\t@echo " + Constants.TOOL_LINKER_C_KEY + "\n"
+ "\t@for i in $(LINK.c) ; do printf \"\\t%s\\n\" \"$$i\" ; done\n"
+ "\t@echo " + Constants.TOOL_LINKER_CPP_KEY + "\n"
+ "\t@for i in $(LINK.cc) ; do printf \"\\t%s\\n\" \"$$i\" ; done\n"
);
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (out != null) {
out.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
|