Fixing minor bugs in callback generation
[iot2.git] / iotjava / Makefile
1 BASE := ..
2
3 include $(BASE)/common.mk
4
5 all: tree parser compiler rmi
6
7 # Parser compilation and run
8 PHONY += tree
9 tree:
10         $(JAVAC) -cp .:$(PARSERJARS) -d $(BIN_DIR) iotpolicy/tree/*.java
11
12 PHONY += parser
13 parser:
14         $(JAVAC) -cp .:$(PARSERJARS) -d $(BIN_DIR) iotpolicy/parser/*.java
15
16 PHONY += compiler
17 compiler:
18         $(JAVAC) -cp .:$(PARSERJARS) -d $(BIN_DIR) iotpolicy/*.java
19         cp ../config/iotpolicy/*.pol $(BIN_DIR)/iotpolicy/
20
21 PHONY += run-compiler
22 run-compiler:
23         cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler camerapolicy.pol camerarequires.pol lightbulbpolicy.pol lightbulbrequires.pol -cplus Cplus -java Java
24
25 # Runtime system compilation
26 PHONY += runtime
27 runtime:
28         $(JAVAC) -classpath . iotruntime/master/*.java -d $(BIN_DIR)
29
30 # TODO: Can remove this later - just to test-compile the resulted files from the compiler
31 PHONY += compile
32 compile:
33         cd $(BIN_DIR)/iotpolicy/output_files; cp *.java ./Java
34         cd $(BIN_DIR)/iotpolicy/output_files; cp *.hpp ./Cplus
35 #       cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) *.java
36 #       cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./*.hpp --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
37         cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./Camera_Skeleton.hpp --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
38
39 PHONY += clean
40 clean:
41         cd $(BIN_DIR)/iotpolicy/output_files; rm -rf *.class *.gch
42         cd $(BIN_DIR)/iotpolicy/output_files/Java; rm -rf *.class
43         cd $(BIN_DIR)/iotpolicy/output_files/Cplus; rm -rf *.gch
44
45 # RMI compilation and run
46 PHONY += rmi
47 rmi:
48         mkdir -p $(BIN_DIR)
49 #       $(JAVAC) -cp .:../$(BIN_DIR) -d $(BIN_DIR) iotrmi/Java/*.java
50 #       $(JAVAC) -cp .:../$(BIN_DIR) -d $(BIN_DIR) iotrmi/Java/sample/*.java
51 #       mkdir -p $(BIN_DIR)/iotrmi/C++
52         #$(G++) iotrmi/C++/IoTSocketServer.cpp -o $(BIN_DIR)/iotrmi/C++/IoTSocketServer.out
53         #$(G++) iotrmi/C++/IoTSocketClient.cpp -o $(BIN_DIR)/iotrmi/C++/IoTSocketClient.out
54 #       $(G++) iotrmi/C++/IoTRMICall.cpp -o $(BIN_DIR)/iotrmi/C++/IoTRMICall.out --std=c++11
55 #       $(G++) iotrmi/C++/IoTRMIObject.cpp -o $(BIN_DIR)/iotrmi/C++/IoTRMIObject.out --std=c++11
56         mkdir -p $(BIN_DIR)/iotrmi/C++/sample
57         #$(G++) iotrmi/C++/sample/CallBackInterface.hpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBackInterface.out --std=c++11
58         #$(G++) iotrmi/C++/sample/CallBack.hpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack.out --std=c++11
59 #       $(G++) iotrmi/C++/sample/CallBack_CBStub.hpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack_CBStub.out --std=c++11
60 #       $(G++) iotrmi/C++/sample/CallBack_CBSkeleton.hpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack_CBSkeleton.out --std=c++11
61 #       $(G++) iotrmi/C++/sample/CallBack_Stub.cpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack_Stub.out --std=c++11
62 #       $(G++) iotrmi/C++/sample/CallBack_Skeleton.cpp -o $(BIN_DIR)/iotrmi/C++/sample/CallBack_Skeleton.out --std=c++11
63         #$(G++) iotrmi/C++/sample/TestClass.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass.out --std=c++11
64 #       $(G++) iotrmi/C++/sample/TestClass_Stub.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass_Stub.out --std=c++11 -pthread -pg
65         $(G++) iotrmi/C++/sample/TestClass_Skeleton.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass_Skeleton.out --std=c++11 -pthread -pg
66         #$(G++) iotrmi/C++/sample/Test.cpp -o ../bin/iotrmi/C++/sample/Test.out --std=c++11 -lpthread
67         #$(G++) iotrmi/C++/sample/Test2.cpp -o ../bin/iotrmi/C++/sample/Test2.out --std=c++11 -pthread -pg
68 #       $(G++) iotrmi/C++/sample/StructC.cpp -o ../bin/iotrmi/C++/sample/StructC.out --std=c++11
69 #       $(G++) iotrmi/C++/sample/EnumC.cpp -o ../bin/iotrmi/C++/sample/EnumC.out --std=c++11
70
71
72 PHONY += run-rmiserver
73 run-rmiserver:
74         $(JAVA) -cp .:$(BIN_DIR) iotrmi.Java.sample.TestClass_Skeleton
75
76 PHONY += run-rmiclient
77 run-rmiclient:
78         $(JAVA) -cp .:$(BIN_DIR) iotrmi.Java.sample.TestClass_Stub
79
80 PHONY += doc
81 doc: iotruntime iotinstaller
82         $(JAVADOC) -d $(DOCS_DIR) iotpolicy/*.java
83
84 .PHONY: $(PHONY)