summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-03 17:38:44 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-03 17:38:44 +0200
commitc4914a0649090b4784b72909eab53ea01e20a93e (patch)
tree9ccb209052893dadb3e97fbd737a243374b056d1
parent43cb556708d727376724eac0e67207c28d1761bf (diff)
First shot at spprinter's Makefile + README update
-rw-r--r--README.md3
-rw-r--r--sol-pretty-printer/Makefile68
2 files changed, 68 insertions, 3 deletions
diff --git a/README.md b/README.md
index dd20a1d..2479f31 100644
--- a/README.md
+++ b/README.md
@@ -31,9 +31,6 @@ format (none available yet).
### How to Use
1. Clone the repository.
-2. Head to the ``instr-to-kodkod`` folder.
3. Use ``make run`` to automatically fetch missing jars, compile everything and
launch the current configuration (which is found in the ``Makefile``). The use
of parallel processing is recommended (e.g. ``make run -j14``).
-4. Go into the ``data/predicate/`` folder (from the project's root directory).
-``.pro`` files are property files, ``.sol`` (solution) files are the results.
diff --git a/sol-pretty-printer/Makefile b/sol-pretty-printer/Makefile
new file mode 100644
index 0000000..4c5d954
--- /dev/null
+++ b/sol-pretty-printer/Makefile
@@ -0,0 +1,68 @@
+## Parameters ##################################################################
+#### Where to find the solutions.
+ifndef SOL_DIR
+SOL_DIR =
+endif
+
+#### Where to find the model's data
+ifndef MODEL_DIR
+MODEL_DIR =
+endif
+
+#### Where to find the properties' pretty-print files
+ifndef PROPERTY_FILES
+PROPERTY_FILES =
+endif
+
+#### Binaries
+###### JRE binary
+ifndef JAVA
+JAVA = java
+endif
+
+###### JDK binary
+ifndef JAVAC
+JAVAC = javac
+endif
+
+## Parameters Sanity Check #####################################################
+ifeq ($(strip $(SOL_DIR)),)
+$(error No SOL_DIR defined as parameter.)
+endif
+
+ifeq ($(strip $(MODEL_DIR)),)
+$(error No MODEL_DIR defined as parameter.)
+endif
+
+ifeq ($(strip $(PROPERTY_FILES)),)
+$(error No PROPERTY_FILES defined as parameter.)
+endif
+
+ifeq ($(strip $(JAVA)),)
+$(error No Java executable defined as parameter.)
+endif
+
+ifeq ($(strip $(JAVAC)),)
+$(error No Java compiler defined as parameter.)
+endif
+
+################################################################################
+CLASSPATH = "./src/"
+
+## Makefile Magic ##############################################################
+SOURCES = $(wildcard src/*.java)
+CLASSES = $(SOURCES:.java=.class)
+
+SOLUTION_FILES = $(wildcard $(SOL_DIR)/*.sol)
+PROPERTY_PP_FILES = $(PROPERTY_FILES:.pro=.pp)
+SOLUTION_PP_PAIRS = \
+ $(foreach sf,$(SOLUTION_FILES),"$(sf) $(filter %$(basename $(notdir $(sf))).pp,$(PROPERTY_PP_FILES))")
+
+run: $(SOLUTION_PP_PAIRS) $(MODEL_DIR)/structural.mod $(MODEL_DIR)/string_to_instr.map $(CLASSES)
+ $(JAVA) $(MODEL_DIR)/structural.mod $(MODEL_DIR)/string_to_instr.map $(SOLUTION_PP_PAIRS)
+
+%.class: %.java
+ $(JAVAC) -cp $(CLASSPATH) $<
+
+clean:
+ rm -f $(CLASSES)