Adding more directory structure to generated files by compiler, also script to copy...
[iot2.git] / others / tutorial / benchmarks / application / SmartLights / Makefile
diff --git a/others/tutorial/benchmarks/application/SmartLights/Makefile b/others/tutorial/benchmarks/application/SmartLights/Makefile
new file mode 100644 (file)
index 0000000..ce4bbf5
--- /dev/null
@@ -0,0 +1,31 @@
+BASE = ../../..
+
+include $(BASE)/common.mk
+
+JFLAGS = -d $(BIN_DIR) -cp $(BIN_DIR):$(CHECKERJARS):.
+JARFLAGS = cf 
+JARFLAGS_SMARTLIGHTS = cf SmartLights.jar
+
+# checker option
+#
+CHECKER_OPT = -processor iotchecker.IoTJavaChecker -AprintErrorStack
+
+ASTUBS = -Astubs=../../../checker/astubs/ 
+
+all: smartlights
+
+check-all: check-smartlights
+
+PHONY += smartlights
+smartlights:
+       $(JAVAC) $(JFLAGS) *.java
+       cp SmartLights.config $(BIN_DIR)/SmartLights
+       cd $(BIN_DIR)/SmartLights; $(JAR) $(JARFLAGS) SmartLights.jar ../SmartLights/SmartLights*.class ../SmartLights/LightBulb*.class ../iotcode/SmartLightBulb/*.class ../iotcode/interfaces/LightBulb*.class; mkdir tmp; mv SmartLights.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
+
+PHONY += check-smartlights
+check-smartlights:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
+       cp SmartLights.config $(BIN_DIR)/SmartLights
+       cd $(BIN_DIR)/SmartLights; $(JAR) $(JARFLAGS) SmartLights.jar ../SmartLights/SmartLights*.class ../SmartLights/LightBulb*.class ../iotcode/SmartLightBulb/*.class ../iotcode/interfaces/LightBulb*.class; mkdir tmp; mv SmartLights.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
+
+.PHONY: $(PHONY)