include $(BASE)/common.mk
-all: iotparser
+all: tree parser compiler rmi
-PHONY += iotparser
-iotparser:
- $(JAVAC) -cp .:$(PARSERJARS) -d $(BIN_DIR) iotparser/*.java
- cp ../config/iotparser/* $(BIN_DIR)/iotparser/
+# Parser compilation and run
+PHONY += tree
+tree:
+ $(JAVAC) -cp .:$(PARSERJARS) -d $(BIN_DIR) iotpolicy/tree/*.java
-PHONY += iotparse
-iotparse:
- cd $(BIN_DIR)/iotparser; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotparser.Parser policy.pol out.xml
+PHONY += parser
+parser:
+ $(JAVAC) -cp .:$(PARSERJARS) -d $(BIN_DIR) iotpolicy/parser/*.java
+
+PHONY += compiler
+compiler:
+ $(JAVAC) -cp .:$(PARSERJARS) -d $(BIN_DIR) iotpolicy/*.java
+ cp ../config/iotpolicy/*.pol $(BIN_DIR)/iotpolicy/
+
+PHONY += run-compiler
+run-compiler:
+ cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler camerapolicy.pol camerarequires.pol lightbulbpolicy.pol lightbulbrequires.pol -cplus Cplus -java Java
+
+# Runtime system compilation
+PHONY += runtime
+runtime:
+ $(JAVAC) -classpath . iotruntime/master/*.java -d $(BIN_DIR)
+
+# RMI compilation and run
+PHONY += rmi
+rmi:
+ mkdir -p $(BIN_DIR)
+# $(JAVAC) -cp .:../$(BIN_DIR) -d $(BIN_DIR) iotrmi/Java/*.java
+# $(JAVAC) -cp .:../$(BIN_DIR) -d $(BIN_DIR) iotrmi/Java/sample/*.java
+# mkdir -p $(BIN_DIR)/iotrmi/C++
+ #$(G++) iotrmi/C++/IoTSocketServer.cpp -o $(BIN_DIR)/iotrmi/C++/IoTSocketServer.out
+ #$(G++) iotrmi/C++/IoTSocketClient.cpp -o $(BIN_DIR)/iotrmi/C++/IoTSocketClient.out
+# $(G++) iotrmi/C++/IoTRMICall.cpp -o $(BIN_DIR)/iotrmi/C++/IoTRMICall.out --std=c++11
+# $(G++) iotrmi/C++/IoTRMIObject.cpp -o $(BIN_DIR)/iotrmi/C++/IoTRMIObject.out --std=c++11
+ mkdir -p $(BIN_DIR)/iotrmi/C++/sample
+ #$(G++) iotrmi/C++/sample/CallBackInterface.hpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBackInterface.out --std=c++11
+ #$(G++) iotrmi/C++/sample/CallBack.hpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack.out --std=c++11
+# $(G++) iotrmi/C++/sample/CallBack_CBStub.hpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack_CBStub.out --std=c++11
+# $(G++) iotrmi/C++/sample/CallBack_CBSkeleton.hpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack_CBSkeleton.out --std=c++11
+# $(G++) iotrmi/C++/sample/CallBack_Stub.cpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack_Stub.out --std=c++11
+# $(G++) iotrmi/C++/sample/CallBack_Skeleton.cpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack_Skeleton.out --std=c++11
+ #$(G++) iotrmi/C++/sample/TestClass.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass.out --std=c++11
+ $(G++) iotrmi/C++/sample/TestClass_Stub.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass_Stub.out --std=c++11 -pthread
+ $(G++) iotrmi/C++/sample/TestClass_Skeleton.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass_Skeleton.out --std=c++11 -pthread
+ #$(G++) iotrmi/C++/sample/Test.cpp -o ../bin/iotrmi/C++/sample/Test.out --std=c++11 -lpthread
+ #$(G++) iotrmi/C++/sample/Test2.cpp -o ../bin/iotrmi/C++/sample/Test2.out --std=c++11 -pthread -pg
+# $(G++) iotrmi/C++/sample/StructC.cpp -o ../bin/iotrmi/C++/sample/StructC.out --std=c++11
+# $(G++) iotrmi/C++/sample/EnumC.cpp -o ../bin/iotrmi/C++/sample/EnumC.out --std=c++11
+
+
+PHONY += run-rmiserver
+run-rmiserver:
+ $(JAVA) -cp .:$(BIN_DIR) iotrmi.Java.sample.TestClass_Skeleton
+
+PHONY += run-rmiclient
+run-rmiclient:
+ $(JAVA) -cp .:$(BIN_DIR) iotrmi.Java.sample.TestClass_Stub
PHONY += doc
doc: iotruntime iotinstaller
- $(JAVADOC) -d $(DOCS_DIR) iotparser/*.java
+ $(JAVADOC) -d $(DOCS_DIR) iotpolicy/*.java
.PHONY: $(PHONY)