diff --git a/prism/Makefile b/prism/Makefile index 07a9a937..aaa5db1a 100644 --- a/prism/Makefile +++ b/prism/Makefile @@ -294,7 +294,7 @@ JAVA_INCLUDES = -I $(JAVA_JNI_H_DIR) -I $(JAVA_JNI_MD_H_DIR) # Main part of Makefile # ######################### -MAKE_DIRS = dd jdd odd dv prism mtbdd sparse hybrid parser settings userinterface pepa/compiler simulator jltl2ba jltl2dstar explicit pta param strat +MAKE_DIRS = dd jdd odd dv prism mtbdd sparse hybrid parser settings userinterface pepa/compiler simulator jltl2ba jltl2dstar explicit pta param strat automata EXT_PACKAGES = lpsolve55 lp_solve_5.5_java diff --git a/prism/src/automata/Makefile b/prism/src/automata/Makefile new file mode 100644 index 00000000..47112e19 --- /dev/null +++ b/prism/src/automata/Makefile @@ -0,0 +1,39 @@ +################################################ +# NB: This Makefile is designed to be called # +# from the main PRISM Makefile. It won't # +# work on its own because it needs # +# various options to be passed in # +################################################ + +.SUFFIXES: .o .c .cc + +# Reminder: $@ = target, $* = target without extension, $< = dependency + +THIS_DIR = automata +PRISM_DIR_REL = ../.. + +JAVA_FILES_ALL = $(wildcard *.java) +JAVA_FILES = $(subst package-info.java,,$(JAVA_FILES_ALL)) +CLASS_FILES = $(JAVA_FILES:%.java=$(PRISM_DIR_REL)/$(CLASSES_DIR)/$(THIS_DIR)/%.class) + +PRISM_CLASSPATH = "$(THIS_DIR)/$(PRISM_DIR_REL)/$(CLASSES_DIR)$(CLASSPATHSEP)$(THIS_DIR)/$(PRISM_DIR_REL)/lib/*" + +default: all + +all: checks $(CLASS_FILES) + +# Try and prevent accidental makes (i.e. called manually, not from top-level Makefile) +checks: + @if [ "$(SRC_DIR)" = "" ]; then \ + (echo "Error: This Makefile is designed to be called from the main PRISM Makefile"; exit 1) \ + fi; + +$(PRISM_DIR_REL)/$(CLASSES_DIR)/$(THIS_DIR)/%.class: %.java + (cd ..; $(JAVAC) -sourcepath $(THIS_DIR)/$(PRISM_DIR_REL)/$(SRC_DIR) -classpath $(PRISM_CLASSPATH) -d $(THIS_DIR)/$(PRISM_DIR_REL)/$(CLASSES_DIR) $(THIS_DIR)/$<) + +clean: checks + @rm -f $(CLASS_FILES) + +celan: clean + +#################################################