diff options
Diffstat (limited to 'org.rtems.cdt.toolchain2/org/rtems/cdt/Activator.java')
-rw-r--r-- | org.rtems.cdt.toolchain2/org/rtems/cdt/Activator.java | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/org.rtems.cdt.toolchain2/org/rtems/cdt/Activator.java b/org.rtems.cdt.toolchain2/org/rtems/cdt/Activator.java index 91c0faa..3376ca1 100644 --- a/org.rtems.cdt.toolchain2/org/rtems/cdt/Activator.java +++ b/org.rtems.cdt.toolchain2/org/rtems/cdt/Activator.java @@ -12,19 +12,21 @@ 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; +import org.rtems.cdt.Constants; public class Activator extends AbstractUIPlugin { private static Activator mPlugin; - - public Activator() { - super(); - } public void start( BundleContext context) throws Exception { super.start( context); mPlugin = this; + createBSPInfoMakefile(); } public void stop( BundleContext context) throws Exception { @@ -35,4 +37,45 @@ public class Activator extends AbstractUIPlugin { 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 $(RTEMS_MAKEFILE_PATH)/Makefile.inc\n" + + "include $(RTEMS_CUSTOM)\n" + + "include $(PROJECT_ROOT)/make/leaf.cfg\n" + + "\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(); + } + } + } } |