Skip to content

Instantly share code, notes, and snippets.

@shouichi
Created January 11, 2012 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shouichi/1593330 to your computer and use it in GitHub Desktop.
Save shouichi/1593330 to your computer and use it in GitHub Desktop.
Run "make" to run on normal JVM, "make jpf" to run on JPF.
import java.util.EnumSet;
public class EnumTest {
enum Option {
A
}
public static void main(String[] args) {
EnumSet<Option> options = EnumSet.allOf(Option.class);
for (Option option : options) {
assert option != null;
}
}
}
enum-test = ${config_path}
enum-test.classpath = ${config_path}
RM=rm -f
JAVAC=javac
JAVAC_FLAGS=-g
JAVA=java
JAVA_FLAGS=-ea
JPF=~/jpf/jpf-core/bin/jpf
SOURCES=EnumTest.java
CLASSES=$(SOURCES:.java=.class)
all: run
run: $(CLASSES)
$(JAVA) $(JAVA_FLAGS) `basename $< .class`
jpf: $(CLASSES)
$(JPF) `basename $< .class`
.SUFFIXES:
.SUFFIXES: .java .class
.java.class:
$(JAVAC) $(JAFAC_FLAG) $<
.PHONY: clean
clean:
$(RM) *.class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment