cooja quickstart should be started from normal cooja working directory, otherwise config relative paths won't work

+
cygwin path fix for quickstart
This commit is contained in:
fros4943 2009-03-12 13:04:10 +00:00
parent 80bbc92ffe
commit 063bf88f90
2 changed files with 12 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $Id: Makefile.cooja,v 1.26 2009/03/11 08:40:37 fros4943 Exp $
# $Id: Makefile.cooja,v 1.27 2009/03/12 13:04:11 fros4943 Exp $
## The COOJA Simulator Contiki platform Makefile
##
@ -34,7 +34,8 @@ $(CONTIKI)/tools/cooja/dist/cooja.jar:
# Quickstart rule
$(MAKECMDGOALS): $(CONTIKI)/tools/cooja/dist/cooja.jar
java -jar $(CONTIKI)/tools/cooja/dist/cooja.jar -quickstart=$(MAKECMDGOALS) -contiki=$(CONTIKI)
(cd $(CONTIKI)/tools/cooja/build && \
java -jar ../dist/cooja.jar -quickstart='$(abspath $(firstword $(MAKECMDGOALS)))')
endif ## QUICKSTART
@ -96,6 +97,7 @@ ifdef REDEF_PRINTF
endif ## REDEF_PRINTF
$(LINK_COMMAND_1) $^ $(LINK_COMMAND_2)
.PHONY: $(CONTIKI_APP).cooja
$(CONTIKI_APP).cooja: $(JNILIB)
cp $(JNILIB) $@
rm $(CONTIKI_APP_OBJ)

View File

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: GUI.java,v 1.114 2009/03/11 20:14:52 fros4943 Exp $
* $Id: GUI.java,v 1.115 2009/03/12 13:04:10 fros4943 Exp $
*/
package se.sics.cooja;
@ -2878,12 +2878,18 @@ public class GUI extends Observable {
String contikiApp = args[0].substring("-quickstart=".length());
if (contikiApp.endsWith(".cooja")) {
contikiApp = contikiApp.substring(0, contikiApp.length() - 6);
contikiApp = contikiApp.substring(0, contikiApp.length() - ".cooja".length());
}
if (!contikiApp.endsWith(".c")) {
contikiApp += ".c";
}
/* Cygwin fix */
if (contikiApp.startsWith("/cygdrive/")) {
char driveCharacter = contikiApp.charAt("/cygdrive/".length());
contikiApp = contikiApp.replace("/cygdrive/" + driveCharacter + "/", driveCharacter + ":/");
}
boolean ok = quickStartSimulation(contikiApp);
if (!ok) {
System.exit(1);