removed old unused makefile-quickstart code
+ tidied up some code
This commit is contained in:
parent
1a3761e1a9
commit
c729adb8ee
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: MoteDebugger.java,v 1.1 2006/08/21 12:13:14 fros4943 Exp $
|
* $Id: MoteDebugger.java,v 1.2 2006/09/06 12:26:33 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
|
@ -96,7 +96,7 @@ public class MoteDebugger extends VisPlugin {;
|
||||||
logger.info("Extracted PID=" + pid);
|
logger.info("Extracted PID=" + pid);
|
||||||
|
|
||||||
logger.info("Checking that source code file exists..");
|
logger.info("Checking that source code file exists..");
|
||||||
File sourceFile = new File("obj_cooja/" + moteToDebug.getType().getIdentifier() + ".c");
|
File sourceFile = new File(ContikiMoteType.tempOutputDirectory, moteToDebug.getType().getIdentifier() + ".c");
|
||||||
if (!sourceFile.exists()) {
|
if (!sourceFile.exists()) {
|
||||||
logger.fatal("Can't find source file: " + sourceFile);
|
logger.fatal("Can't find source file: " + sourceFile);
|
||||||
return;
|
return;
|
||||||
|
@ -114,7 +114,7 @@ public class MoteDebugger extends VisPlugin {;
|
||||||
logger.info("Function name is: " + functionName);
|
logger.info("Function name is: " + functionName);
|
||||||
|
|
||||||
logger.info("Creating temporary file .tmp with initial commands");
|
logger.info("Creating temporary file .tmp with initial commands");
|
||||||
File tmpFile = new File("obj_cooja/" + ".tmp");
|
File tmpFile = new File(ContikiMoteType.tempOutputDirectory, ".tmp");
|
||||||
if (tmpFile.exists()) {
|
if (tmpFile.exists()) {
|
||||||
tmpFile.delete();
|
tmpFile.delete();
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ public class MoteDebugger extends VisPlugin {;
|
||||||
gdbProcess = Runtime.getRuntime().exec("xterm -e gdb"
|
gdbProcess = Runtime.getRuntime().exec("xterm -e gdb"
|
||||||
+ " -nw -quiet "
|
+ " -nw -quiet "
|
||||||
+ " --pid=" + pid
|
+ " --pid=" + pid
|
||||||
+ " -x " + "obj_cooja/" + tmpFile.getName()
|
+ " -x " + ContikiMoteType.tempOutputDirectory.getName() + "/" + tmpFile.getName()
|
||||||
);
|
);
|
||||||
|
|
||||||
logger.info("Sleeping 2500 ms while starting up GDB");
|
logger.info("Sleeping 2500 ms while starting up GDB");
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: GUI.java,v 1.6 2006/09/06 10:23:24 fros4943 Exp $
|
* $Id: GUI.java,v 1.7 2006/09/06 12:26:33 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja;
|
package se.sics.cooja;
|
||||||
|
@ -449,12 +449,12 @@ public class GUI extends JDesktopPane {
|
||||||
File contikiBaseDir = new File(getExternalToolsSetting("PATH_CONTIKI"));
|
File contikiBaseDir = new File(getExternalToolsSetting("PATH_CONTIKI"));
|
||||||
File contikiCoreDir = new File(contikiBaseDir,
|
File contikiCoreDir = new File(contikiBaseDir,
|
||||||
getExternalToolsSetting("PATH_COOJA_CORE_RELATIVE"));
|
getExternalToolsSetting("PATH_COOJA_CORE_RELATIVE"));
|
||||||
File libFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File libFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + moteTypeID + ContikiMoteType.librarySuffix);
|
moteTypeID + ContikiMoteType.librarySuffix);
|
||||||
File mapFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File mapFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + moteTypeID + ContikiMoteType.mapSuffix);
|
moteTypeID + ContikiMoteType.mapSuffix);
|
||||||
File depFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File depFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + moteTypeID + ContikiMoteType.dependSuffix);
|
moteTypeID + ContikiMoteType.dependSuffix);
|
||||||
if (libFile.exists())
|
if (libFile.exists())
|
||||||
libFile.delete();
|
libFile.delete();
|
||||||
if (depFile.exists())
|
if (depFile.exists())
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: PlatformConfig.java,v 1.2 2006/08/22 15:28:17 fros4943 Exp $
|
* $Id: PlatformConfig.java,v 1.3 2006/09/06 12:26:33 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja;
|
package se.sics.cooja;
|
||||||
|
@ -134,8 +134,8 @@ public class PlatformConfig {
|
||||||
*/
|
*/
|
||||||
public boolean appendUserPlatform(File userPlatform)
|
public boolean appendUserPlatform(File userPlatform)
|
||||||
throws FileNotFoundException, IOException {
|
throws FileNotFoundException, IOException {
|
||||||
File userPlatformConfig = new File(userPlatform.getPath()
|
File userPlatformConfig = new File(userPlatform.getPath(),
|
||||||
+ File.separatorChar + GUI.PLATFORM_CONFIG_FILENAME);
|
GUI.PLATFORM_CONFIG_FILENAME);
|
||||||
myUserPlatformHistory.add(userPlatform);
|
myUserPlatformHistory.add(userPlatform);
|
||||||
return appendConfigFile(userPlatformConfig);
|
return appendConfigFile(userPlatformConfig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: ContikiMoteType.java,v 1.2 2006/08/23 17:11:59 fros4943 Exp $
|
* $Id: ContikiMoteType.java,v 1.3 2006/09/06 12:26:33 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.contikimote;
|
package se.sics.cooja.contikimote;
|
||||||
|
@ -86,7 +86,7 @@ public class ContikiMoteType implements MoteType {
|
||||||
/**
|
/**
|
||||||
* Temporary output directory
|
* Temporary output directory
|
||||||
*/
|
*/
|
||||||
final static public File tempOutputDirectory = new File("." + File.separatorChar + "obj_cooja" + File.separatorChar);
|
final static public File tempOutputDirectory = new File("obj_cooja");
|
||||||
|
|
||||||
// Regular expressions for parsing the map file
|
// Regular expressions for parsing the map file
|
||||||
final static private String bssSectionAddrRegExp = "^.bss[ \t]*0x([0-9A-Fa-f]*)[ \t]*0x[0-9A-Fa-f]*[ \t]*$";
|
final static private String bssSectionAddrRegExp = "^.bss[ \t]*0x([0-9A-Fa-f]*)[ \t]*0x[0-9A-Fa-f]*[ \t]*$";
|
||||||
|
@ -182,10 +182,10 @@ public class ContikiMoteType implements MoteType {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
File libFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File libFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + identifier + librarySuffix);
|
identifier + librarySuffix);
|
||||||
File mapFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File mapFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + identifier + mapSuffix);
|
identifier + mapSuffix);
|
||||||
|
|
||||||
// Check that library file exists
|
// Check that library file exists
|
||||||
if (!libFile.exists()) {
|
if (!libFile.exists()) {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: ContikiMoteTypeDialog.java,v 1.8 2006/09/06 10:32:31 fros4943 Exp $
|
* $Id: ContikiMoteTypeDialog.java,v 1.9 2006/09/06 12:26:33 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.contikimote;
|
package se.sics.cooja.contikimote;
|
||||||
|
@ -158,8 +158,8 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
// Check if library file with given identifier has already been loaded
|
// Check if library file with given identifier has already been loaded
|
||||||
if (identifierOK
|
if (identifierOK
|
||||||
&& CoreComm.hasLibraryFileBeenLoaded(new File(
|
&& CoreComm.hasLibraryFileBeenLoaded(new File(
|
||||||
ContikiMoteType.tempOutputDirectory.getPath()
|
ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + testIdentifier
|
testIdentifier
|
||||||
+ ContikiMoteType.librarySuffix))) {
|
+ ContikiMoteType.librarySuffix))) {
|
||||||
identifierOK = false;
|
identifierOK = false;
|
||||||
}
|
}
|
||||||
|
@ -893,12 +893,12 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
progressBar.setString("..compiling..");
|
progressBar.setString("..compiling..");
|
||||||
final File contikiDir = new File(textContikiDir.getText());
|
final File contikiDir = new File(textContikiDir.getText());
|
||||||
final String identifier = textID.getText();
|
final String identifier = textID.getText();
|
||||||
File libFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File libFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + identifier + ContikiMoteType.librarySuffix);
|
identifier + ContikiMoteType.librarySuffix);
|
||||||
File mapFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File mapFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + identifier + ContikiMoteType.mapSuffix);
|
identifier + ContikiMoteType.mapSuffix);
|
||||||
File depFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File depFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + identifier + ContikiMoteType.dependSuffix);
|
identifier + ContikiMoteType.dependSuffix);
|
||||||
|
|
||||||
if (libFile.exists()) {
|
if (libFile.exists()) {
|
||||||
libFile.delete();
|
libFile.delete();
|
||||||
|
@ -1163,12 +1163,12 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
public static boolean compileLibrary(String identifier, File contikiDir,
|
public static boolean compileLibrary(String identifier, File contikiDir,
|
||||||
Vector<File> sourceFiles, final MessageList appender) {
|
Vector<File> sourceFiles, final MessageList appender) {
|
||||||
|
|
||||||
File libFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File libFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + identifier + ContikiMoteType.librarySuffix);
|
identifier + ContikiMoteType.librarySuffix);
|
||||||
File mapFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File mapFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + identifier + ContikiMoteType.mapSuffix);
|
identifier + ContikiMoteType.mapSuffix);
|
||||||
File depFile = new File(ContikiMoteType.tempOutputDirectory.getPath()
|
File depFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
+ File.separatorChar + identifier + ContikiMoteType.dependSuffix);
|
identifier + ContikiMoteType.dependSuffix);
|
||||||
|
|
||||||
// Recheck that contiki path exists
|
// Recheck that contiki path exists
|
||||||
if (!contikiDir.exists()) {
|
if (!contikiDir.exists()) {
|
||||||
|
@ -1251,7 +1251,7 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
"LD_ARGS_2=" + GUI.getExternalToolsSetting("LINKER_ARGS_2", ""),
|
"LD_ARGS_2=" + GUI.getExternalToolsSetting("LINKER_ARGS_2", ""),
|
||||||
"EXTRA_CC_ARGS=" + ccFlags,
|
"EXTRA_CC_ARGS=" + ccFlags,
|
||||||
"CC=" + GUI.getExternalToolsSetting("PATH_C_COMPILER"),
|
"CC=" + GUI.getExternalToolsSetting("PATH_C_COMPILER"),
|
||||||
"LD=" + GUI.getExternalToolsSetting("PATH_LINKER"), "COMPILE_MAIN=1",
|
"LD=" + GUI.getExternalToolsSetting("PATH_LINKER"),
|
||||||
"PROJECTDIRS=" + sourceDirs,
|
"PROJECTDIRS=" + sourceDirs,
|
||||||
"PROJECT_SOURCEFILES=" + sourceFileNames,
|
"PROJECT_SOURCEFILES=" + sourceFileNames,
|
||||||
"PATH=" + System.getenv("PATH")};
|
"PATH=" + System.getenv("PATH")};
|
||||||
|
@ -1304,8 +1304,10 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
err.close();
|
err.close();
|
||||||
|
|
||||||
p.waitFor();
|
p.waitFor();
|
||||||
if (p.exitValue() != 0)
|
if (p.exitValue() != 0) {
|
||||||
|
logger.fatal("Make file returned error: " + p.exitValue());
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.fatal("Error while compiling library: " + e);
|
logger.fatal("Error while compiling library: " + e);
|
||||||
return false;
|
return false;
|
||||||
|
@ -1778,8 +1780,8 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
|
|
||||||
// Check that all user platforms are valid
|
// Check that all user platforms are valid
|
||||||
for (File userPlatform : moteTypeUserPlatforms) {
|
for (File userPlatform : moteTypeUserPlatforms) {
|
||||||
File userPlatformConfig = new File(userPlatform.getPath()
|
File userPlatformConfig = new File(userPlatform.getPath(),
|
||||||
+ File.separatorChar + GUI.PLATFORM_CONFIG_FILENAME);
|
GUI.PLATFORM_CONFIG_FILENAME);
|
||||||
if (!userPlatformConfig.exists()) {
|
if (!userPlatformConfig.exists()) {
|
||||||
textUserPlatforms.setBackground(Color.RED);
|
textUserPlatforms.setBackground(Color.RED);
|
||||||
textUserPlatforms.setToolTipText("Invalid user platform: "
|
textUserPlatforms.setToolTipText("Invalid user platform: "
|
||||||
|
@ -1866,7 +1868,7 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
dispose();
|
dispose();
|
||||||
} else if (e.getActionCommand().equals("clean")) {
|
} else if (e.getActionCommand().equals("clean")) {
|
||||||
// Delete any created intermediate files
|
// Delete any created intermediate files
|
||||||
File objectDir = new File("obj_cooja");
|
File objectDir = ContikiMoteType.tempOutputDirectory;
|
||||||
if (objectDir.exists() && objectDir.isDirectory()) {
|
if (objectDir.exists() && objectDir.isDirectory()) {
|
||||||
File[] objectFiles = objectDir.listFiles();
|
File[] objectFiles = objectDir.listFiles();
|
||||||
for (File objectFile : objectFiles)
|
for (File objectFile : objectFiles)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: UserPlatformsDialog.java,v 1.4 2006/08/23 14:29:44 fros4943 Exp $
|
* $Id: UserPlatformsDialog.java,v 1.5 2006/09/06 12:26:33 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.dialogs;
|
package se.sics.cooja.dialogs;
|
||||||
|
@ -371,8 +371,8 @@ public class UserPlatformsDialog extends JDialog {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
File userPlatformConfigFile = new File(userPlatform.getPath()
|
File userPlatformConfigFile = new File(userPlatform.getPath(),
|
||||||
+ File.separatorChar + GUI.PLATFORM_CONFIG_FILENAME);
|
GUI.PLATFORM_CONFIG_FILENAME);
|
||||||
if (!userPlatformConfigFile.exists()) {
|
if (!userPlatformConfigFile.exists()) {
|
||||||
logger.fatal("User platform has no configuration file: "
|
logger.fatal("User platform has no configuration file: "
|
||||||
+ userPlatformConfigFile);
|
+ userPlatformConfigFile);
|
||||||
|
|
Loading…
Reference in a new issue