From 91e4fd9368118a2b23b2a5e80631ca226fb8d3a0 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 12 Feb 2012 11:21:32 +0100 Subject: [PATCH] Initial java program This is using gcj, which should faster for startup than openjdk, I think. --- .gitignore | 1 + Makefile | 10 ++++++++-- java/Null.java | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 java/Null.java diff --git a/.gitignore b/.gitignore index c703ac4..8debced 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /haskell/null-threaded /ocaml/null-byte /ocaml/null-opt +/java/null-gcj diff --git a/Makefile b/Makefile index e290bf9..1f6f5ce 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ PROGS = \ c/c-libc-static-null c/c-libc-dynamic-null \ c/c++-static-null c/c++-dynamic-null \ haskell/null-single haskell/null-threaded \ - ocaml/null-byte ocaml/null-opt + ocaml/null-byte ocaml/null-opt \ + java/null-gcj SCRIPTS = \ dash/null.dash bash/null.bash \ @@ -74,6 +75,10 @@ ocaml/null-opt: ocaml/null.ml ocamlopt -o $@ $< strip $@ +java/null-gcj: java/Null.java + gcj-4.6 --main=Null -o $@ $< + strip $@ + log: $(PROGS) $(SCRIPTS) Makefile rm -f log; \ for prog in $(PROGS) $(SCRIPTS); do \ @@ -86,7 +91,8 @@ log: $(PROGS) $(SCRIPTS) Makefile .PHONY: log clean: - cd asm && rm *.o + cd asm && rm -f *.o cd haskell && rm -f *.hi *.o cd ocaml && rm -f *.cmo *.cmi *.cmx *.o + cd java && rm -f *.class rm -f $(PROGS) diff --git a/java/Null.java b/java/Null.java new file mode 100644 index 0000000..3ca6d6d --- /dev/null +++ b/java/Null.java @@ -0,0 +1,5 @@ +public class Null { + public static void main(String[] args) { + System.exit(0); + } +} \ No newline at end of file -- 2.39.5