Skip to content

Commit

Permalink
Add convenience .bat/.sh to run NQP on JVM.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Apr 18, 2013
1 parent 459c817 commit 6918dfd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ config.default
bin
nqp-runtime.jar
*.class
/nqp.bat
/nqp.sh
1 change: 1 addition & 0 deletions ConfigureJVM.pl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
$config{'shell'} = $^O eq 'MSWin32' ? 'cmd' : 'sh';
$config{'make'} = $^O eq 'MSWin32' ? 'nmake' : 'make';
$config{'cpsep'} = $^O eq 'MSWin32' ? ';' : ':';
$config{'runner'} = $^O eq 'MSWin32' ? 'nqp.bat' : 'nqp.sh';

fill_template_file('tools/build/Makefile-JVM.in', 'Makefile', %config);

Expand Down
1 change: 1 addition & 0 deletions src/vm/jvm/nqp.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@java -cp .;nqp-runtime.jar;3rdparty/asm/asm-4.1.jar nqp %*
2 changes: 2 additions & 0 deletions src/vm/jvm/nqp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
java -cp .:nqp-runtime.jar:3rdparty/asm/asm-4.1.jar nqp $@
9 changes: 8 additions & 1 deletion tools/build/Makefile-JVM.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ASM = 3rdparty/asm/

MKPATH = $(PERL) -MExtUtils::Command -e mkpath
CP = $(PERL) -MExtUtils::Command -e cp
CHMOD = $(PERL) -MExtUtils::Command -e chmod

RUNTIME_JAVAS = \
src/vm/jvm/runtime/org/perl6/nqp/jast2bc/*.java \
Expand Down Expand Up @@ -131,7 +132,9 @@ ALL_OUTPUT = $(NQP_MO_CLASS) $(MODULE_LOADER_CLASS) \
$(JASTNODES_CLASS) $(QAST_CLASS) \
$(P6QREGEX_CLASS) $(NQP_CLASS) \

all: $(ALL_OUTPUT)
RUNNER = @runner@

all: $(ALL_OUTPUT) $(RUNNER)

$(RUNTIME_JAR): $(RUNTIME_JAVAS)
$(PERL) -MExtUtils::Command -e mkpath bin
Expand Down Expand Up @@ -290,3 +293,7 @@ $(ALL_OUTPUT): $(STAGE2_OUTPUT)
$(CP) $(STAGE2)/$(QAST_CLASS) .
$(CP) $(STAGE2)/$(P6QREGEX_CLASS) .
$(CP) $(STAGE2)/$(NQP_CLASS) .

$(RUNNER):
$(CP) src/vm/jvm/$(RUNNER) .
$(CHMOD) 755 $(RUNNER)

0 comments on commit 6918dfd

Please sign in to comment.