changed link argument sent to makefile:
instead of using linker, user may specify linker line including tools
This commit is contained in:
parent
661a76408a
commit
db74bb6566
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile.cooja,v 1.18 2007/05/21 14:57:47 fros4943 Exp $
|
# $Id: Makefile.cooja,v 1.19 2007/09/05 14:04:17 fros4943 Exp $
|
||||||
|
|
||||||
## The COOJA Simulator Contiki platform Makefile
|
## The COOJA Simulator Contiki platform Makefile
|
||||||
##
|
##
|
||||||
|
@ -48,7 +48,7 @@ endif ## QUICKSTART
|
||||||
|
|
||||||
OUTPUT_DIR = obj_cooja
|
OUTPUT_DIR = obj_cooja
|
||||||
LIBFILE = $(OUTPUT_DIR)/$(TYPEID).library
|
LIBFILE = $(OUTPUT_DIR)/$(TYPEID).library
|
||||||
DEPFILE = $(OUTPUT_DIR)/$(TYPEID).a
|
ARFILE = $(OUTPUT_DIR)/$(TYPEID).a
|
||||||
MAPFILE = $(OUTPUT_DIR)/$(TYPEID).map
|
MAPFILE = $(OUTPUT_DIR)/$(TYPEID).map
|
||||||
MAINFILE = $(OUTPUT_DIR)/$(TYPEID).co
|
MAINFILE = $(OUTPUT_DIR)/$(TYPEID).co
|
||||||
|
|
||||||
|
@ -79,19 +79,19 @@ CFLAGSNO = $(EXTRA_CC_ARGS) -Wall -g -I/usr/local/include
|
||||||
CFLAGS = $(CFLAGSNO)
|
CFLAGS = $(CFLAGSNO)
|
||||||
|
|
||||||
### Define custom targets
|
### Define custom targets
|
||||||
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(DEPFILE)
|
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(ARFILE)
|
||||||
ifdef SYMBOLS
|
ifdef SYMBOLS
|
||||||
# Recreate symbols file and relink with final memory layout (twice)
|
# Recreate symbols file and relink with final memory layout (twice)
|
||||||
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
|
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
|
||||||
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2)
|
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
|
||||||
${CONTIKI}/tools/make-symbols-nm $(LIBFILE)
|
${CONTIKI}/tools/make-symbols-nm $(LIBFILE)
|
||||||
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
|
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
|
||||||
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2)
|
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
|
||||||
else
|
else
|
||||||
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2)
|
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(DEPFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)}
|
$(ARFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)}
|
||||||
$(AR) rcf $@ $^
|
$(AR) rcf $@ $^
|
||||||
|
|
||||||
ifndef WINDIR
|
ifndef WINDIR
|
||||||
|
|
|
@ -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.32 2007/05/28 07:26:51 fros4943 Exp $
|
* $Id: ContikiMoteTypeDialog.java,v 1.33 2007/09/05 14:00:59 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.contikimote;
|
package se.sics.cooja.contikimote;
|
||||||
|
@ -217,11 +217,12 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
.getProjectDirs();
|
.getProjectDirs();
|
||||||
String projectText = null;
|
String projectText = null;
|
||||||
for (File projectDir : myDialog.moteTypeProjectDirs) {
|
for (File projectDir : myDialog.moteTypeProjectDirs) {
|
||||||
if (projectText == null)
|
if (projectText == null) {
|
||||||
projectText = "'" + projectDir.getPath() + "'";
|
projectText = "'" + projectDir.getPath() + "'";
|
||||||
else
|
} else {
|
||||||
projectText += ", '" + projectDir.getPath() + "'";
|
projectText += ", '" + projectDir.getPath() + "'";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
myDialog.textProjectDirs.setText(projectText);
|
myDialog.textProjectDirs.setText(projectText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,31 +526,34 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
textField.setText("[enter description here]");
|
textField.setText("[enter description here]");
|
||||||
textField.getDocument().addDocumentListener(new DocumentListener() {
|
textField.getDocument().addDocumentListener(new DocumentListener() {
|
||||||
public void insertUpdate(DocumentEvent e) {
|
public void insertUpdate(DocumentEvent e) {
|
||||||
if (myDialog.isVisible())
|
if (myDialog.isVisible()) {
|
||||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
updateVisualFields();
|
updateVisualFields();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void removeUpdate(DocumentEvent e) {
|
public void removeUpdate(DocumentEvent e) {
|
||||||
if (myDialog.isVisible())
|
if (myDialog.isVisible()) {
|
||||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
updateVisualFields();
|
updateVisualFields();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void changedUpdate(DocumentEvent e) {
|
public void changedUpdate(DocumentEvent e) {
|
||||||
if (myDialog.isVisible())
|
if (myDialog.isVisible()) {
|
||||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
updateVisualFields();
|
updateVisualFields();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
textDescription = textField;
|
textDescription = textField;
|
||||||
|
@ -781,17 +785,21 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
showAdvancedCheckBox.addActionListener(new ActionListener() {
|
showAdvancedCheckBox.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (((JCheckBox) e.getSource()).isSelected()) {
|
if (((JCheckBox) e.getSource()).isSelected()) {
|
||||||
if (entireCoreInterfacePane != null)
|
if (entireCoreInterfacePane != null) {
|
||||||
entireCoreInterfacePane.setVisible(true);
|
entireCoreInterfacePane.setVisible(true);
|
||||||
if (entireSensorPane != null)
|
}
|
||||||
|
if (entireSensorPane != null) {
|
||||||
entireSensorPane.setVisible(true);
|
entireSensorPane.setVisible(true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (entireCoreInterfacePane != null)
|
if (entireCoreInterfacePane != null) {
|
||||||
entireCoreInterfacePane.setVisible(false);
|
entireCoreInterfacePane.setVisible(false);
|
||||||
if (entireSensorPane != null)
|
}
|
||||||
|
if (entireSensorPane != null) {
|
||||||
entireSensorPane.setVisible(false);
|
entireSensorPane.setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
mainPane.add(new JSeparator());
|
mainPane.add(new JSeparator());
|
||||||
mainPane.add(showAdvancedCheckBox);
|
mainPane.add(showAdvancedCheckBox);
|
||||||
|
@ -1031,8 +1039,9 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
progressDialog.setVisible(true);
|
progressDialog.setVisible(true);
|
||||||
|
|
||||||
// Create temp output directory if not already exists
|
// Create temp output directory if not already exists
|
||||||
if (!ContikiMoteType.tempOutputDirectory.exists())
|
if (!ContikiMoteType.tempOutputDirectory.exists()) {
|
||||||
ContikiMoteType.tempOutputDirectory.mkdir();
|
ContikiMoteType.tempOutputDirectory.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
// Parse selected sensors
|
// Parse selected sensors
|
||||||
Vector<String> sensors = new Vector<String>();
|
Vector<String> sensors = new Vector<String>();
|
||||||
|
@ -1163,9 +1172,10 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
libraryCreatedOK = false;
|
libraryCreatedOK = false;
|
||||||
} else {
|
} else {
|
||||||
libraryCreatedOK = true;
|
libraryCreatedOK = true;
|
||||||
if (!libFile.exists() || !depFile.exists() || !mapFile.exists())
|
if (!libFile.exists() || !depFile.exists() || !mapFile.exists()) {
|
||||||
libraryCreatedOK = false;
|
libraryCreatedOK = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (libraryCreatedOK) {
|
if (libraryCreatedOK) {
|
||||||
progressBar.setBackground(Color.GREEN);
|
progressBar.setBackground(Color.GREEN);
|
||||||
|
@ -1207,39 +1217,44 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
String sensorString = "";
|
String sensorString = "";
|
||||||
String externSensorDefs = "";
|
String externSensorDefs = "";
|
||||||
for (String sensor : sensors) {
|
for (String sensor : sensors) {
|
||||||
if (!sensorString.equals(""))
|
if (!sensorString.equals("")) {
|
||||||
sensorString += ", ";
|
sensorString += ", ";
|
||||||
|
}
|
||||||
sensorString += "&" + sensor;
|
sensorString += "&" + sensor;
|
||||||
externSensorDefs += "extern const struct sensors_sensor " + sensor
|
externSensorDefs += "extern const struct sensors_sensor " + sensor
|
||||||
+ ";\n";
|
+ ";\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sensorString.equals(""))
|
if (!sensorString.equals("")) {
|
||||||
sensorString = "SENSORS(" + sensorString + ");";
|
sensorString = "SENSORS(" + sensorString + ");";
|
||||||
else
|
} else {
|
||||||
sensorString = "SENSORS(NULL);";
|
sensorString = "SENSORS(NULL);";
|
||||||
|
}
|
||||||
|
|
||||||
// CORE INTERFACES
|
// CORE INTERFACES
|
||||||
String interfaceString = "";
|
String interfaceString = "";
|
||||||
String externInterfaceDefs = "";
|
String externInterfaceDefs = "";
|
||||||
for (String coreInterface : coreInterfaces) {
|
for (String coreInterface : coreInterfaces) {
|
||||||
if (!interfaceString.equals(""))
|
if (!interfaceString.equals("")) {
|
||||||
interfaceString += ", ";
|
interfaceString += ", ";
|
||||||
|
}
|
||||||
interfaceString += "&" + coreInterface;
|
interfaceString += "&" + coreInterface;
|
||||||
externInterfaceDefs += "SIM_INTERFACE_NAME(" + coreInterface + ");\n";
|
externInterfaceDefs += "SIM_INTERFACE_NAME(" + coreInterface + ");\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!interfaceString.equals(""))
|
if (!interfaceString.equals("")) {
|
||||||
interfaceString = "SIM_INTERFACES(" + interfaceString + ");";
|
interfaceString = "SIM_INTERFACES(" + interfaceString + ");";
|
||||||
else
|
} else {
|
||||||
interfaceString = "SIM_INTERFACES(NULL);";
|
interfaceString = "SIM_INTERFACES(NULL);";
|
||||||
|
}
|
||||||
|
|
||||||
// PROCESSES (including any default processes)
|
// PROCESSES (including any default processes)
|
||||||
String userProcessString = "";
|
String userProcessString = "";
|
||||||
String externProcessDefs = "";
|
String externProcessDefs = "";
|
||||||
for (String process : userProcesses) {
|
for (String process : userProcesses) {
|
||||||
if (!userProcessString.equals(""))
|
if (!userProcessString.equals("")) {
|
||||||
userProcessString += ", ";
|
userProcessString += ", ";
|
||||||
|
}
|
||||||
userProcessString += "&" + process;
|
userProcessString += "&" + process;
|
||||||
externProcessDefs += "PROCESS_NAME(" + process + ");\n";
|
externProcessDefs += "PROCESS_NAME(" + process + ");\n";
|
||||||
}
|
}
|
||||||
|
@ -1248,8 +1263,9 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
String defaultProcesses[] = GUI.getExternalToolsSetting(
|
String defaultProcesses[] = GUI.getExternalToolsSetting(
|
||||||
"CONTIKI_STANDARD_PROCESSES").split(";");
|
"CONTIKI_STANDARD_PROCESSES").split(";");
|
||||||
for (String process : defaultProcesses) {
|
for (String process : defaultProcesses) {
|
||||||
if (!defaultProcessString.equals(""))
|
if (!defaultProcessString.equals("")) {
|
||||||
defaultProcessString += ", ";
|
defaultProcessString += ", ";
|
||||||
|
}
|
||||||
defaultProcessString += "&" + process;
|
defaultProcessString += "&" + process;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1259,15 +1275,17 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
String processString;
|
String processString;
|
||||||
if (!defaultProcessString.equals(""))
|
if (!defaultProcessString.equals("")) {
|
||||||
processString = "PROCINIT(" + defaultProcessString + ");";
|
processString = "PROCINIT(" + defaultProcessString + ");";
|
||||||
else
|
} else {
|
||||||
processString = "PROCINIT(NULL);";
|
processString = "PROCINIT(NULL);";
|
||||||
|
}
|
||||||
|
|
||||||
if (!userProcessString.equals(""))
|
if (!userProcessString.equals("")) {
|
||||||
processString += "\nAUTOSTART_PROCESSES(" + userProcessString + ");";
|
processString += "\nAUTOSTART_PROCESSES(" + userProcessString + ");";
|
||||||
else
|
} else {
|
||||||
processString += "\nAUTOSTART_PROCESSES(NULL);";
|
processString += "\nAUTOSTART_PROCESSES(NULL);";
|
||||||
|
}
|
||||||
|
|
||||||
// CHECK JNI CLASS AVAILABILITY
|
// CHECK JNI CLASS AVAILABILITY
|
||||||
String libString = CoreComm.getAvailableClassName();
|
String libString = CoreComm.getAvailableClassName();
|
||||||
|
@ -1323,10 +1341,12 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
sourceFile.close();
|
sourceFile.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
try {
|
try {
|
||||||
if (destFile != null)
|
if (destFile != null) {
|
||||||
destFile.close();
|
destFile.close();
|
||||||
if (sourceFile != null)
|
}
|
||||||
|
if (sourceFile != null) {
|
||||||
sourceFile.close();
|
sourceFile.close();
|
||||||
|
}
|
||||||
} catch (Exception e2) {
|
} catch (Exception e2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1362,48 +1382,53 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
identifier + ContikiMoteType.librarySuffix);
|
identifier + ContikiMoteType.librarySuffix);
|
||||||
File mapFile = new File(ContikiMoteType.tempOutputDirectory,
|
File mapFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
identifier + ContikiMoteType.mapSuffix);
|
identifier + ContikiMoteType.mapSuffix);
|
||||||
File depFile = new File(ContikiMoteType.tempOutputDirectory,
|
File arFile = new File(ContikiMoteType.tempOutputDirectory,
|
||||||
identifier + ContikiMoteType.dependSuffix);
|
identifier + ContikiMoteType.dependSuffix);
|
||||||
|
|
||||||
// Recheck that contiki path exists
|
// Recheck that contiki path exists
|
||||||
if (!contikiDir.exists()) {
|
if (!contikiDir.exists()) {
|
||||||
if (errorStream != null)
|
if (errorStream != null) {
|
||||||
errorStream.println("Bad Contiki OS path");
|
errorStream.println("Bad Contiki OS path");
|
||||||
|
}
|
||||||
logger.fatal("Contiki path does not exist: " + contikiDir.getAbsolutePath());
|
logger.fatal("Contiki path does not exist: " + contikiDir.getAbsolutePath());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!contikiDir.isDirectory()) {
|
if (!contikiDir.isDirectory()) {
|
||||||
if (errorStream != null)
|
if (errorStream != null) {
|
||||||
errorStream.println("Bad Contiki OS path");
|
errorStream.println("Bad Contiki OS path");
|
||||||
|
}
|
||||||
logger.fatal("Contiki path is not a directory");
|
logger.fatal("Contiki path is not a directory");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (libFile.exists()) {
|
if (libFile.exists()) {
|
||||||
if (errorStream != null)
|
if (errorStream != null) {
|
||||||
errorStream.println("Bad output filenames");
|
errorStream.println("Bad output filenames");
|
||||||
|
}
|
||||||
logger.fatal("Could not overwrite already existing library");
|
logger.fatal("Could not overwrite already existing library");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CoreComm.hasLibraryFileBeenLoaded(libFile)) {
|
if (CoreComm.hasLibraryFileBeenLoaded(libFile)) {
|
||||||
if (errorStream != null)
|
if (errorStream != null) {
|
||||||
errorStream.println("Bad output filenames");
|
errorStream.println("Bad output filenames");
|
||||||
logger
|
}
|
||||||
.fatal("A library has already been loaded with the same name before");
|
logger.fatal("A library has already been loaded with the same name before");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (depFile.exists()) {
|
if (arFile.exists()) {
|
||||||
if (errorStream != null)
|
if (errorStream != null) {
|
||||||
errorStream.println("Bad output filenames");
|
errorStream.println("Bad output filenames");
|
||||||
|
}
|
||||||
logger.fatal("Could not overwrite already existing dependency file");
|
logger.fatal("Could not overwrite already existing dependency file");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapFile.exists()) {
|
if (mapFile.exists()) {
|
||||||
if (errorStream != null)
|
if (errorStream != null) {
|
||||||
errorStream.println("Bad output filenames");
|
errorStream.println("Bad output filenames");
|
||||||
|
}
|
||||||
logger.fatal("Could not overwrite already existing map file");
|
logger.fatal("Could not overwrite already existing map file");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1419,13 +1444,27 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
|
|
||||||
String sourceDirs = System.getProperty("PROJECTDIRS", "");
|
String sourceDirs = System.getProperty("PROJECTDIRS", "");
|
||||||
String sourceFileNames = "";
|
String sourceFileNames = "";
|
||||||
String ccFlags = GUI.getExternalToolsSetting("COMPILER_ARGS", "");
|
|
||||||
|
|
||||||
// Replace Java home references
|
// Prepare compilation command
|
||||||
if (ccFlags.contains("$(JAVA_HOME)")) {
|
String ccFlags = GUI.getExternalToolsSetting("COMPILER_ARGS", "");
|
||||||
String javaHome = (String) System.getenv().get("JAVA_HOME");
|
String link1 = GUI.getExternalToolsSetting("LINK_COMMAND_1", "");
|
||||||
ccFlags = ccFlags.replace("$(JAVA_HOME)", javaHome);
|
String link2 = GUI.getExternalToolsSetting("LINK_COMMAND_2", "");
|
||||||
}
|
|
||||||
|
link1 = link1.replace("$(MAPFILE)", mapFile.getPath().replace(File.separatorChar, '/'));
|
||||||
|
link2 = link2.replace("$(MAPFILE)", mapFile.getPath().replace(File.separatorChar, '/'));
|
||||||
|
ccFlags = ccFlags.replace("$(MAPFILE)", mapFile.getPath().replace(File.separatorChar, '/'));
|
||||||
|
|
||||||
|
link1 = link1.replace("$(LIBFILE)", libFile.getPath().replace(File.separatorChar, '/'));
|
||||||
|
link2 = link2.replace("$(LIBFILE)", libFile.getPath().replace(File.separatorChar, '/'));
|
||||||
|
ccFlags = ccFlags.replace("$(LIBFILE)", libFile.getPath().replace(File.separatorChar, '/'));
|
||||||
|
|
||||||
|
link1 = link1.replace("$(ARFILE)", arFile.getPath().replace(File.separatorChar, '/'));
|
||||||
|
link2 = link2.replace("$(ARFILE)", arFile.getPath().replace(File.separatorChar, '/'));
|
||||||
|
ccFlags = ccFlags.replace("$(DEPFILE)", arFile.getPath().replace(File.separatorChar, '/'));
|
||||||
|
|
||||||
|
link1 = link1.replace("$(JAVA_HOME)", System.getenv().get("JAVA_HOME"));
|
||||||
|
link2 = link2.replace("$(JAVA_HOME)", System.getenv().get("JAVA_HOME"));
|
||||||
|
ccFlags = ccFlags.replace("$(JAVA_HOME)", System.getenv().get("JAVA_HOME"));
|
||||||
|
|
||||||
for (File sourceFile : sourceFiles) {
|
for (File sourceFile : sourceFiles) {
|
||||||
if (sourceFile.isDirectory()) {
|
if (sourceFile.isDirectory()) {
|
||||||
|
@ -1458,8 +1497,8 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
String[] env = new String[]{
|
String[] env = new String[]{
|
||||||
"CONTIKI=" + contikiDir.getPath().replace(File.separatorChar, '/'),
|
"CONTIKI=" + contikiDir.getPath().replace(File.separatorChar, '/'),
|
||||||
"TARGET=cooja", "TYPEID=" + identifier,
|
"TARGET=cooja", "TYPEID=" + identifier,
|
||||||
"LD_ARGS_1=" + GUI.getExternalToolsSetting("LINKER_ARGS_1", ""),
|
"LINK_COMMAND_1=" + link1,
|
||||||
"LD_ARGS_2=" + GUI.getExternalToolsSetting("LINKER_ARGS_2", ""),
|
"LINK_COMMAND_2=" + link2,
|
||||||
"EXTRA_CC_ARGS=" + ccFlags,
|
"EXTRA_CC_ARGS=" + ccFlags,
|
||||||
"SYMBOLS=" + (includeSymbols?"1":""),
|
"SYMBOLS=" + (includeSymbols?"1":""),
|
||||||
"CC=" + GUI.getExternalToolsSetting("PATH_C_COMPILER"),
|
"CC=" + GUI.getExternalToolsSetting("PATH_C_COMPILER"),
|
||||||
|
@ -1489,9 +1528,10 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
String readLine;
|
String readLine;
|
||||||
try {
|
try {
|
||||||
while ((readLine = input.readLine()) != null) {
|
while ((readLine = input.readLine()) != null) {
|
||||||
if (outputStream != null && readLine != null)
|
if (outputStream != null && readLine != null) {
|
||||||
outputStream.println(readLine);
|
outputStream.println(readLine);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.warn("Error while reading from process");
|
logger.warn("Error while reading from process");
|
||||||
}
|
}
|
||||||
|
@ -1503,9 +1543,10 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
String readLine;
|
String readLine;
|
||||||
try {
|
try {
|
||||||
while ((readLine = err.readLine()) != null) {
|
while ((readLine = err.readLine()) != null) {
|
||||||
if (errorStream != null && readLine != null)
|
if (errorStream != null && readLine != null) {
|
||||||
errorStream.println(readLine);
|
errorStream.println(readLine);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.warn("Error while reading from process");
|
logger.warn("Error while reading from process");
|
||||||
}
|
}
|
||||||
|
@ -1646,8 +1687,9 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
|
|
||||||
BufferedReader err = new BufferedReader(new InputStreamReader(p
|
BufferedReader err = new BufferedReader(new InputStreamReader(p
|
||||||
.getErrorStream()));
|
.getErrorStream()));
|
||||||
if (err.ready())
|
if (err.ready()) {
|
||||||
logger.warn("Error occured during scan:");
|
logger.warn("Error occured during scan:");
|
||||||
|
}
|
||||||
while ((line = err.readLine()) != null) {
|
while ((line = err.readLine()) != null) {
|
||||||
logger.warn(line);
|
logger.warn(line);
|
||||||
}
|
}
|
||||||
|
@ -1711,8 +1753,9 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
|
|
||||||
BufferedReader err = new BufferedReader(new InputStreamReader(p
|
BufferedReader err = new BufferedReader(new InputStreamReader(p
|
||||||
.getErrorStream()));
|
.getErrorStream()));
|
||||||
if (err.ready())
|
if (err.ready()) {
|
||||||
logger.warn("Error occured during scan:");
|
logger.warn("Error occured during scan:");
|
||||||
|
}
|
||||||
while ((line = err.readLine()) != null) {
|
while ((line = err.readLine()) != null) {
|
||||||
logger.warn(line);
|
logger.warn(line);
|
||||||
}
|
}
|
||||||
|
@ -1771,19 +1814,23 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
File sourceFile = new File(textCoreDir.getText(), sourceFilename);
|
File sourceFile = new File(textCoreDir.getText(), sourceFilename);
|
||||||
|
|
||||||
boolean foundFile = sourceFile.exists();
|
boolean foundFile = sourceFile.exists();
|
||||||
if (!foundFile)
|
if (!foundFile) {
|
||||||
for (File projectDir : myGUI.getProjectDirs()) {
|
for (File projectDir : myGUI.getProjectDirs()) {
|
||||||
sourceFile = new File(projectDir, sourceFilename);
|
sourceFile = new File(projectDir, sourceFilename);
|
||||||
if (foundFile = sourceFile.exists())
|
if (foundFile = sourceFile.exists()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!foundFile)
|
if (!foundFile) {
|
||||||
for (File projectDir : moteTypeProjectDirs) {
|
for (File projectDir : moteTypeProjectDirs) {
|
||||||
sourceFile = new File(projectDir, sourceFilename);
|
sourceFile = new File(projectDir, sourceFilename);
|
||||||
if (foundFile = sourceFile.exists())
|
if (foundFile = sourceFile.exists()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!foundFile) {
|
if (!foundFile) {
|
||||||
// Die quietly
|
// Die quietly
|
||||||
|
@ -2057,29 +2104,32 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
ActionListener,
|
ActionListener,
|
||||||
DocumentListener {
|
DocumentListener {
|
||||||
public void insertUpdate(DocumentEvent e) {
|
public void insertUpdate(DocumentEvent e) {
|
||||||
if (myDialog.isVisible())
|
if (myDialog.isVisible()) {
|
||||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
pathsWereUpdated();
|
pathsWereUpdated();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public void removeUpdate(DocumentEvent e) {
|
public void removeUpdate(DocumentEvent e) {
|
||||||
if (myDialog.isVisible())
|
if (myDialog.isVisible()) {
|
||||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
pathsWereUpdated();
|
pathsWereUpdated();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public void changedUpdate(DocumentEvent e) {
|
public void changedUpdate(DocumentEvent e) {
|
||||||
if (myDialog.isVisible())
|
if (myDialog.isVisible()) {
|
||||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
pathsWereUpdated();
|
pathsWereUpdated();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (e.getActionCommand().equals("cancel")) {
|
if (e.getActionCommand().equals("cancel")) {
|
||||||
// Cancel creation of mote type
|
// Cancel creation of mote type
|
||||||
|
@ -2090,8 +2140,9 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
File objectDir = ContikiMoteType.tempOutputDirectory;
|
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) {
|
||||||
objectFile.delete();
|
objectFile.delete();
|
||||||
|
}
|
||||||
|
|
||||||
objectDir.delete();
|
objectDir.delete();
|
||||||
}
|
}
|
||||||
|
@ -2189,11 +2240,12 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
moteTypeProjectDirs = newProjectDirs;
|
moteTypeProjectDirs = newProjectDirs;
|
||||||
String projectDirText = null;
|
String projectDirText = null;
|
||||||
for (File projectDir : newProjectDirs) {
|
for (File projectDir : newProjectDirs) {
|
||||||
if (projectDirText == null)
|
if (projectDirText == null) {
|
||||||
projectDirText = "'" + projectDir.getPath() + "'";
|
projectDirText = "'" + projectDir.getPath() + "'";
|
||||||
else
|
} else {
|
||||||
projectDirText += " + '" + projectDir.getPath() + "'";
|
projectDirText += " + '" + projectDir.getPath() + "'";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
textProjectDirs.setText(projectDirText);
|
textProjectDirs.setText(projectDirText);
|
||||||
|
|
||||||
createButton.setEnabled(libraryCreatedOK = false);
|
createButton.setEnabled(libraryCreatedOK = false);
|
||||||
|
@ -2431,13 +2483,15 @@ public class ContikiMoteTypeDialog extends JDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!processWasSelected || sourceFilename == null)
|
if (!processWasSelected || sourceFilename == null) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
autoSelectDependencyProcesses(processName, sourceFilename, true);
|
autoSelectDependencyProcesses(processName, sourceFilename, true);
|
||||||
|
|
||||||
} else
|
} else {
|
||||||
logger.warn("Unhandled action: " + e.getActionCommand());
|
logger.warn("Unhandled action: " + e.getActionCommand());
|
||||||
|
}
|
||||||
|
|
||||||
createButton.setEnabled(libraryCreatedOK = false);
|
createButton.setEnabled(libraryCreatedOK = false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue