Commits

Brian McKenna  committed bed62cc

Initial commit

  • Participants

Comments (0)

Files changed (9)

+target
+tmp
+tools
+lib
+YETI_URL=http://linux.ee/~mzz/yeti/yeti.jar
+STAB_URL=http://stab-language.googlecode.com/files/stab-1.0beta2.zip
+CLOJURE_URL=http://github.com/downloads/clojure/clojure/clojure-1.2.0.zip
+GROOVY_URL=http://dist.groovy.codehaus.org/distributions/groovy-binary-1.7.10.zip
+STAB_URL=http://stab-language.googlecode.com/svn/trunk/bin
+SCALA_URL=http://lampsvn.epfl.ch/svn-repos/scala/scala/tags/R_2_8_1_final/lib
+
+all:
+	[ -e target ] || mkdir target
+	javac -d target src/HelloJava.java
+	java -Xbootclasspath/a:lib/scala-library.jar:tools/scala-compiler.jar -classpath lib/scala-library.jar:tools/scala-compiler.jar scala.tools.nsc.Main -d target -cp target src/HelloScala.scala
+	tools/groovy-1.7.10/bin/groovyc -cp target -d target src/HelloGroovy.groovy
+	java -cp lib/asm-3.3.jar:tools/stabrt.jar:tools/stabc.jar stab.tools.compiler.Application -out:target -cp:"target;lib/scala-library.jar;lib/groovy-1.7.10.jar" src/HelloStab.stab
+	java -cp lib/clojure.jar:src:target -Dclojure.compile.path=target clojure.lang.Compile HelloClojure
+	java -jar lib/yeti.jar -d target -cp target src/HelloYeti.yeti
+	javac -d target -cp target src/HelloWorld.java
+
+deps:
+	[ -e lib/yeti.jar ] || wget -O lib/yeti.jar $(YETI_URL)
+
+	[ -e tmp ] || mkdir tmp
+	[ -e tools ] || mkdir tools
+	[ -e lib ] || mkdir lib
+
+	[ -e tmp/stab-language-bin ] || svn checkout $(STAB_URL) tmp/stab-language-bin
+	[ -e lib/asm-3.3.jar ] || cp tmp/stab-language-bin/asm-3.3.jar lib
+	[ -e tools/stabc.jar ] || cp tmp/stab-language-bin/stabc.jar tools
+	[ -e tools/stabrt.jar ] || cp tmp/stab-language-bin/stabrt.jar tools
+
+	[ -e tmp/scala-lib ] || svn checkout $(SCALA_URL) tmp/scala-lib
+	[ -e lib/scala-compiler.jar ] || cp tmp/scala-lib/scala-compiler.jar tools
+	[ -e lib/scala-library.jar ] || cp tmp/scala-lib/scala-library.jar lib
+
+	[ -e tmp/clojure-1.2.0.zip ] || wget --no-check-certificate -O tmp/clojure-1.2.0.zip $(CLOJURE_URL)
+	[ -e tmp/clojure-1.2.0 ] || unzip -d tmp tmp/clojure-1.2.0.zip
+	[ -e lib/clojure.jar ] || cp tmp/clojure-1.2.0/clojure.jar lib
+
+	[ -e tmp/groovy-binary-1.7.10.zip ] || wget -O tmp/groovy-binary-1.7.10.zip $(GROOVY_URL)
+	[ -e tools/groovy-1.7.10 ] || unzip -d tools tmp/groovy-binary-1.7.10.zip
+	[ -e lib/groovy-1.7.10.jar ] || cp tools/groovy-1.7.10/lib/groovy-1.7.10.jar lib
+
+run:
+	java -cp target:lib/clojure.jar:lib/scala-library.jar:lib/groovy-1.7.10.jar:lib/asm-3.3.jar HelloWorld
+
+clean:
+	rm target/*.class

File src/HelloClojure.clj

+(ns HelloClojure
+  (:gen-class
+    :name HelloClojure
+    :methods [#^{:static true} [printHello [] void]]))
+
+(import 'HelloStab)
+
+(defn -printHello []
+  (HelloStab/printHello))

File src/HelloGroovy.groovy

+import HelloScala;
+
+class HelloGroovy {
+    static void printHello() {
+        HelloScala.printHello();
+    }
+}

File src/HelloJava.java

+class HelloJava {
+	public static void printHello() {
+		System.out.println("Hello world");
+	}
+}

File src/HelloScala.scala

+import HelloJava._;
+
+object HelloScala {
+    def printHello() {
+        HelloJava.printHello();
+    }
+}

File src/HelloStab.stab

+using HelloGroovy;
+
+public class HelloStab {
+    public static void printHello() {
+        HelloGroovy.printHello();
+    }
+}

File src/HelloWorld.java

+class HelloWorld {
+	public static void main(String args[]) {
+		HelloYeti.printHello();
+	}
+}

File src/HelloYeti.yeti

+module _;
+
+import HelloClojure;
+
+class HelloYeti
+    static void printHello()
+        HelloClojure#printHello()
+end