| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-28 16:27:12 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-28 16:27:12 +0200 | 
| commit | ee9d405bc917be3f596ccd2ffd2d7ddc01687d31 (patch) | |
| tree | f9287d5bc3cd50f7251e459751e49043d0e54525 /instance-calculator/Makefile | |
| parent | 2a13a7957f08429c8b5c905032b26c51de57885f (diff) | |
Starts the Instance Calculator
Diffstat (limited to 'instance-calculator/Makefile')
| -rw-r--r-- | instance-calculator/Makefile | 69 | 
1 files changed, 69 insertions, 0 deletions
| diff --git a/instance-calculator/Makefile b/instance-calculator/Makefile new file mode 100644 index 0000000..8da7891 --- /dev/null +++ b/instance-calculator/Makefile @@ -0,0 +1,69 @@ +## Parameters ################################################################## +#### Where to find the model +ifndef MODEL_DIR +MODEL_DIR = +endif + +#### Where to store the Instance model +ifndef INSTANCE_MODEL_DIR +INSTANCE_MODEL_DIR = +endif + +#### Binaries +###### JRE binary +ifndef JAVA +JAVA = java +endif + +###### JDK binary +ifndef JAVAC +JAVAC = javac +endif + +## Parameters Sanity Check ##################################################### +ifeq ($(strip $(MODEL_DIR)),) +$(error No MODEL_DIR defined as parameter.) +endif + +ifeq ($(strip $(INSTANCE_MODEL_DIR)),) +$(error No INSTANCE_MODEL_DIR 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) +MODEL_FILES = $(MODEL_DIR)/structural.mod +OUTPUT_FILE = $(INSTANCE_MODEL_DIR)/instances.mod + +## Makefile Rules ############################################################## +compile: $(CLASSES) + +model: $(CLASSES) $(INSTANCE_MODEL_DIR) $(OUTPUT_FILE) + +clean: +	rm -f $(CLASSES) +	rm -f $(PATH_MODEL_DIR)/*.mod + +clean_model: +	rm -f $(PATH_MODEL_DIR)/*.mod +######## +%.class: %.java +	$(JAVAC) -cp $(CLASSPATH) $< + +$(OUTPUT_FILE): $(MODEL_FILE) $(CLASSES) +	$(JAVA) -cp $(CLASSPATH) Main $< $@ + +$(INSTANCE_MODEL_DIR): +	mkdir -p $(INSTANCE_MODEL_DIR) + | 


