Fixing misunderstood config files for the phone app.
[iot2.git] / iotjava / Makefile
index 0939bd72d576d0583d35eb3363b74ee055700109..94c01f6acc16a75472e8f048ad066bb46c9dc508 100644 (file)
@@ -1,8 +1,9 @@
+
 BASE := ..
 
 include $(BASE)/common.mk
 
-all: mkdir tree parser compiler rmi runtime installer
+all: mkdir tree parser compiler rmi runtime runtime-cpp installer
 
 infra: runtime installer
 
@@ -10,6 +11,11 @@ PHONY += mkdir
 mkdir:
        [ -d ../bin ] || mkdir ../bin
 
+# C++ slave
+PHONY += runtime-cpp
+runtime-cpp:
+       cd iotruntime/cpp/iotslave; make cpp
+
 # Parser compilation and run
 PHONY += tree
 tree:
@@ -23,227 +29,175 @@ PHONY += compiler
 compiler:
        $(JAVAC) -cp .:$(PARSERJARS) -d $(BIN_DIR) iotpolicy/*.java
 
-PHONY += run-compiler-dev
-run-compiler-dev:
-       cp ../localconfig/iotpolicy/development/*.pol $(BIN_DIR)/iotpolicy/
-       #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler testclasspolicy_profiling.pol testclassrequires_profiling.pol -cplus Cplus -java Java
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler testclasspolicy.pol testclassrequires.pol callbackpolicy.pol callbackrequires.pol -cplus Cplus -java Java
-       #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler callbackpolicy.pol callbackrequires.pol testclasspolicy_advanced.pol testclassrequires_advanced.pol -cplus Cplus -java Java
-       #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler callbackpolicy.pol callbackrequires.pol testclasspolicy_callbacks.pol testclassrequires_callbacks.pol -cplus Cplus -java Java
-       #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler testclasspolicy_callbacks.pol testclassrequires_callbacks.pol callbackpolicy.pol callbackrequires.pol -cplus Cplus -java Java
-       #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler testclasspolicy_callbacks_three.pol testclassrequires_callbacks_three.pol callbackpolicy.pol callbackrequires.pol callbackpolicy_two.pol callbackrequires_two.pol -cplus Cplus -java Java
+# Cleaning the compiler output
+PHONY += output-clean
+output-clean:
+       rm -rf $(BIN_DIR)/iotpolicy/output_files
+       rm -rf $(BIN_DIR)/iotpolicy/*.req
+       rm -rf $(BIN_DIR)/iotpolicy/*.pol
+
+# RMI compilation (for Java)
+# Note: For C++, the RMI will be in the binary file of the generated .so file of the stub and skeleton
+PHONY += rmi
+rmi:
+       $(JAVAC) -cp .:../$(BIN_DIR) -d $(BIN_DIR) iotrmi/Java/*.java
 
+PHONY += installer
+installer:
+       $(JAVAC)  -d $(BIN_DIR) iotinstaller/*.java
+       cp ../localconfig/iotruntime/MySQLInterface.config $(BIN_DIR)/iotruntime/
+       cp ../localconfig/iotruntime/MySQLInterface.config $(BIN_DIR)/iotinstaller/
+       cp -r ../localconfig/SupportedDevices/ $(BIN_DIR)/
+       cp ../localconfig/SupportedDevices/driversList.config $(BIN_DIR)/iotinstaller/
+       cp ../localconfig/SupportedDevices/AddressInformation.config $(BIN_DIR)/iotinstaller/
 
+PHONY += runtime
+runtime:
+       $(JAVAC) -classpath .:$(RUNTIMEJARS):$(PHONEJARS):$(ZIPJARS) iotruntime/*.java iotruntime/master/*.java iotruntime/slave/*.java iotruntime/messages/*.java iotruntime/stub/*.java iotruntime/zigbee/*.java -d $(BIN_DIR)
+       cp ../localconfig/iotruntime/IoTMaster.config $(BIN_DIR)/iotruntime/
+       cp ../localconfig/iotruntime/IoTSlave.config $(BIN_DIR)/iotruntime/
+       cp ../localconfig/iotruntime/*.bash $(BIN_DIR)/iotruntime/
+       cp -r ../localconfig/mysql $(BIN_DIR)/iotruntime/
+       cp -r ../localconfig/tomoyo $(BIN_DIR)/iotruntime/
+       [ -d $(BIN_DIR)/iotruntime/log ] || mkdir $(BIN_DIR)/iotruntime/log
+
+PHONY += doc
+doc: runtime installer rmi compiler
+       $(JAVADOC) -d $(DOCS_DIR) iotinstaller/*.java iotruntime/*.java iotrmi/*.java iotcompiler/*.java
+
+
+# ==================================================================== #
+#                                                                      #
+# The followings are the variety of make commands for Vigilia compiler #
+#                                                                      #
+# ==================================================================== #
+
+# Lifxtest
 PHONY += run-compiler-lbtest
 run-compiler-lbtest:
        cp ../localconfig/iotpolicy/LifxLightBulb/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/LifxLightBulb/*.req $(BIN_DIR)/iotpolicy/
-       #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler lifxlightbulb.pol lifxtest.req -java Java
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler lifxlightbulb.pol lifxtest.req -cplus Cplus
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont Lifxtest lifxlightbulb.pol lifxtest.req -drv LifxLightBulb -java Java
+       #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont Lifxtest lifxlightbulb.pol lifxtest.req -drv LifxLightBulb -cplus Cplus
 
 # SmartLightsController
 PHONY += run-compiler-smartlight
 run-compiler-smartlight:
        cp ../localconfig/iotpolicy/LifxLightBulb/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/LifxLightBulb/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler lifxlightbulb.pol smartlightsbulb.req amcrestcamera.pol smartlightscam.req motiondetection.pol motiondetection.req room.pol roomsmart.req -java Java
+       cp ../localconfig/iotpolicy/AmcrestCamera/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/AmcrestCamera/*.req $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/Room/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/Room/*.req $(BIN_DIR)/iotpolicy/
+       #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont SmartLightsController lifxlightbulb.pol smartlightsbulb.req -drv LifxLightBulb amcrestcamera.pol smartlightscam.req -drv AmcrestCamera motiondetection.pol motiondetection.req -drv AmcrestCamera room.pol roomsmart.req -drv LabRoom -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont SmartLightsController lifxlightbulb.pol smartlightsbulb.req -drv LifxLightBulb amcrestcamera.pol smartlightscam.req -drv AmcrestCamera motiondetection.pol motiondetection.req -drv AmcrestCamera room.pol roomsmart.req -drv LabRoom -cplus Cplus
 
 PHONY += run-compiler-lifx
 run-compiler-lifx:
        cp ../localconfig/iotpolicy/LifxLightBulb/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/LifxLightBulb/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler lifxlightbulb.pol smartlightsbulb.req -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont SmartLightsController lifxlightbulb.pol smartlightsbulb.req -drv LifxLightBulb -java Java
        #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler lifxlightbulb.pol smartlightsbulb.req -cplus C++
 
 PHONY += run-compiler-room
 run-compiler-room:
        cp ../localconfig/iotpolicy/Room/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/Room/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler room.pol roomsmart.req -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont SmartLightsController room.pol roomsmart.req -drv LabRoom -java Java
        #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler room.pol roomsmart.req -cplus C++
 
 PHONY += run-compiler-cam
 run-compiler-cam:
        cp ../localconfig/iotpolicy/AmcrestCamera/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/AmcrestCamera/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler amcrestcamera.pol smartlightscam.req motiondetection.pol motiondetection.req -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont SmartLightsController amcrestcamera.pol smartlightscam.req -drv AmcrestCamera motiondetection.pol motiondetection.req -drv AmcrestCamera -java Java
+       #cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler
 
 # IrrigationController
 PHONY += run-compiler-irrigation
 run-compiler-irrigation:
-       cp ../localconfig/iotpolicy/LifxLightBulb/*.pol $(BIN_DIR)/iotpolicy/
-       cp ../localconfig/iotpolicy/LifxLightBulb/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler greenlawn.pol smartlawn.req espsprinkler.pol smartsprinkler.req  weatherphonegateway.pol smartweathergateway.req weathergatewaycallback.pol smartweathergatewaycallback.req sprucesensor.pol smartsensor.req moisturesensorcallback.pol moisturesensorcallback.req -java Java
+       cp ../localconfig/iotpolicy/GreenLawn/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/GreenLawn/*.req $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/BlossomSprinkler/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/BlossomSprinkler/*.req $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/WeatherPhoneGateway/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/WeatherPhoneGateway/*.req $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/SpruceSensor/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/SpruceSensor/*.req $(BIN_DIR)/iotpolicy/
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont IrrigationController greenlawn.pol smartlawn.req -drv GreenLawn blossomsprinkler.pol smartsprinkler.req -drv BlossomSprinkler weatherphonegateway.pol smartweathergateway.req -drv WeatherPhoneGateway weathergatewaycallback.pol smartweathergatewaycallback.req -drv WeatherPhoneGateway sprucesensor.pol smartsensor.req -drv SpruceSensor moisturesensorcallback.pol moisturesensorcallback.req -drv SpruceSensor -java Java
 
 PHONY += run-compiler-lawn
 run-compiler-lawn:
        cp ../localconfig/iotpolicy/GreenLawn/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/GreenLawn/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler greenlawn.pol smartlawn.req -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont IrrigationController greenlawn.pol smartlawn.req -drv GreenLawn -java Java
 
 PHONY += run-compiler-sprk
 run-compiler-sprk:
-       cp ../localconfig/iotpolicy/EspSprinkler/*.pol $(BIN_DIR)/iotpolicy/
-       cp ../localconfig/iotpolicy/EspSprinkler/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler espsprinkler.pol smartsprinkler.req -java Java
+       cp ../localconfig/iotpolicy/BlossomSprinkler/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/BlossomSprinkler/*.req $(BIN_DIR)/iotpolicy/
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont IrrigationController blossomsprinkler.pol smartsprinkler.req -drv BlossomSprinkler -java Java
 
 PHONY += run-compiler-wgw
 run-compiler-wgw:
        cp ../localconfig/iotpolicy/WeatherPhoneGateway/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/WeatherPhoneGateway/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler weatherphonegateway.pol smartweathergateway.req weathergatewaycallback.pol smartweathergatewaycallback.req -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont IrrigationController weatherphonegateway.pol smartweathergateway.req -drv WeatherPhoneGateway weathergatewaycallback.pol smartweathergatewaycallback.req -drv WeatherPhoneGateway -java Java
 
 PHONY += run-compiler-moist
 run-compiler-moist:
        cp ../localconfig/iotpolicy/SpruceSensor/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/SpruceSensor/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler sprucesensor.pol smartsensor.req moisturesensorcallback.pol moisturesensorcallback.req -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont IrrigationController sprucesensor.pol smartsensor.req -drv SpruceSensor moisturesensorcallback.pol moisturesensorcallback.req -drv SpruceSensor -java Java
 
 # SpeakerController
 PHONY += run-compiler-speaker
 run-compiler-speaker:
-       cp ../localconfig/iotpolicy/LifxLightBulb/*.pol $(BIN_DIR)/iotpolicy/
-       cp ../localconfig/iotpolicy/LifxLightBulb/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler ihome.pol smartspeaker.req speakercallback.pol smartspeakercallback.req gpsphonegateway.pol smartgpsgateway.req gpsgatewaycallback.pol smartgpsgatewaycallback.req -java Java
+       cp ../localconfig/iotpolicy/IHome/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/IHome/*.req $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/GPSPhoneGateway/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/GPSPhoneGateway/*.req $(BIN_DIR)/iotpolicy/
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont SpeakerController ihome.pol smartspeaker.req -drv IHome speakercallback.pol smartspeakercallback.req -drv IHome gpsphonegateway.pol smartgpsgateway.req -drv GPSPhoneGateway gpsgatewaycallback.pol smartgpsgatewaycallback.req -drv GPSPhoneGateway -java Java
 
 PHONY += run-compiler-spkr
 run-compiler-spkr:
        cp ../localconfig/iotpolicy/IHome/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/IHome/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler ihome.pol smartspeaker.req speakercallback.pol smartspeakercallback.req -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont SpeakerController ihome.pol smartspeaker.req -drv IHome speakercallback.pol smartspeakercallback.req -drv IHome -java Java
 
 PHONY += run-compiler-ggw
 run-compiler-ggw:
        cp ../localconfig/iotpolicy/GPSPhoneGateway/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/GPSPhoneGateway/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler gpsphonegateway.pol smartgpsgateway.req gpsgatewaycallback.pol smartgpsgatewaycallback.req -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -drv GPSPhoneGateway gpsphonegateway.pol smartgpsgateway.req -drv GPSPhoneGateway gpsgatewaycallback.pol smartgpsgatewaycallback.req -drv GPSPhoneGateway -java Java
 
 # HomeSecurityController
 PHONY += run-compiler-homesec
 run-compiler-homesec:
-       cp ../localconfig/iotpolicy/LifxLightBulb/*.pol $(BIN_DIR)/iotpolicy/
-       cp ../localconfig/iotpolicy/LifxLightBulb/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler espalarm.pol smartalarm.req smartthingssensor.pol smartthingssensor.req smartthingssensorcallback.pol smartthingssensorcallback.req -java Java
+       cp ../localconfig/iotpolicy/DlinkAlarm/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/DlinkAlarm/*.req $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/SmartthingsSensor/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/SmartthingsSensor/*.req $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/SmartthingsActuator/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/SmartthingsActuator/*.req $(BIN_DIR)/iotpolicy/
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont HomeSecurityController dlinkalarm.pol smartalarm.req -drv DlinkAlarm smartthingssensor.pol smartthingssensor.req -drv MotionSensor smartthingssensorcallback.pol smartthingssensorcallback.req -drv MotionSensor smartthingssensor.pol smartthingssensor.req -drv MultipurposeSensor smartthingssensorcallback.pol smartthingssensorcallback.req -drv MultipurposeSensor smartthingssensor.pol smartthingssensor.req -drv WaterLeakSensor smartthingssensorcallback.pol smartthingssensorcallback.req -drv WaterLeakSensor -java Java
 
 PHONY += run-compiler-alarm
 run-compiler-alarm:
-       cp ../localconfig/iotpolicy/EspAlarm/*.pol $(BIN_DIR)/iotpolicy/
-       cp ../localconfig/iotpolicy/EspAlarm/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler espalarm.pol smartalarm.req -java Java
+       cp ../localconfig/iotpolicy/DlinkAlarm/*.pol $(BIN_DIR)/iotpolicy/
+       cp ../localconfig/iotpolicy/DlinkAlarm/*.req $(BIN_DIR)/iotpolicy/
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont HomeSecurityController dlinkalarm.pol smartalarm.req -drv DlinkAlarm -java Java
 
 PHONY += run-compiler-smart
 run-compiler-smart:
        cp ../localconfig/iotpolicy/SmartthingsSensor/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/SmartthingsSensor/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler smartthingssensor.pol smartthingssensor.req smartthingssensorcallback.pol smartthingssensorcallback.req -java Java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont HomeSecurityController smartthingssensor.pol smartthingssensor.req -drv MotionSensor smartthingssensorcallback.pol smartthingssensorcallback.req -drv MotionSensor -java Java
 
 PHONY += run-compiler-actuate
 run-compiler-actuate:
        cp ../localconfig/iotpolicy/SmartthingsActuator/*.pol $(BIN_DIR)/iotpolicy/
        cp ../localconfig/iotpolicy/SmartthingsActuator/*.req $(BIN_DIR)/iotpolicy/
-       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler smartthingsactuator.pol smartthingsactuator.req smartthingsactuatorcallback.pol smartthingsactuatorcallback.req -java Java
-
-# TODO: Can remove this later - just to test-compile the resulted files from the compiler
-PHONY += compile
-compile:
-       cp ./iotrmi/Java/basics/* $(BIN_DIR)/iotpolicy/output_files/Java
-       #cp ./iotrmi/C++/basics/* $(BIN_DIR)/iotpolicy/output_files/Cplus
-       cd $(BIN_DIR)/iotpolicy/output_files; cp *.java ./Java
-       cd $(BIN_DIR)/iotpolicy/output_files; cp *.hpp ./Cplus
-#      cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClass_ProfilingStub.java
-#      cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClass_Skeleton.java
-       #cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClassAdvanced_Stub.java
-       #cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClassCallbacks_Stub.java
-#      cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClassInterface_Skeleton.java -Xlint:unchecked
-#      cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClassComplete_Stub.java -Xlint:unchecked
-#      cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) CallBackInterfaceWithCallBack_Stub.java -Xlint:unchecked
-#      cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) CallBackInterface_Skeleton.java -Xlint:unchecked
-#      cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) CallBackInterface_CallbackSkeleton.java
-#      cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) CallBackInterfaceWithCallBack_CallbackStub.java
-
-       cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./TestClassInterface_Skeleton.cpp -o ./TestClassInterface_Skeleton.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-       cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./TestClassComplete_Stub.cpp -o ./TestClassComplete_Stub.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-       #cp ./iotrmi/C++/ConcurrentLinkedListQueue.cpp $(BIN_DIR)/iotpolicy/output_files/Cplus
-       #cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./ConcurrentLinkedListQueue.cpp -o ./ConcurrentLinkedListQueue.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-
-       #cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./TestClassAdvanced_Stub.cpp -o ./TestClassAdvanced_Stub.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-       #cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./TestClass.hpp -o ./TestClass.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-       #cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./TestClassInterface_Skeleton.cpp -o ./TestClassInterface_Skeleton.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-       #cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(ARM_G++) ./TestClassInterface_Skeleton.cpp -o ./TestClassInterface_Skeleton.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-       #cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(ARM_G++) ./TestClassCallbacks_Stub.cpp -o ./TestClassCallbacks_Stub.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-       #cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(ARM_G++) ./TestClassComplete_Stub.hpp --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-       #cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(ARM_G++) ./TestClassInterface_Skeleton.hpp --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
-
-PHONY += run-java-skeleton
-run-java-skeleton:
-       cd ../bin/iotpolicy/output_files/Java; $(JAVA) -cp .:../../../$(BIN_DIR) TestClass_Skeleton
-
-PHONY += run-java-stub
-run-java-stub:
-       cd ../bin/iotpolicy/output_files/Java; $(JAVA) -cp .:../../../$(BIN_DIR) TestClass_ProfilingStub
-#      cd ../bin/iotpolicy/output_files/Java; $(JAVA) -cp .:../../../$(BIN_DIR) TestClass_Stub
-#      cd ../bin/iotpolicy/output_files/Java; $(JAVA) -cp .:../../../$(BIN_DIR) TestClassAdvanced_Stub
-#      cd ../bin/iotpolicy/output_files/Java; $(JAVA) -cp .:../../../$(BIN_DIR) TestClassCallbacks_Stub
-
-PHONY += run-cplus-skeleton
-run-cplus-skeleton:
-#      ../bin/iotpolicy/output_files/Cplus/TestClass_Skeleton.out
-       ../bin/iotpolicy/output_files/Cplus/TestClassInterface_Skeleton.out
-
-PHONY += run-cplus-stub
-run-cplus-stub:
-#      ../bin/iotpolicy/output_files/Cplus/TestClass_Stub.out
-#      ../bin/iotpolicy/output_files/Cplus/TestClassAdvanced_Stub.out
-#      ../bin/iotpolicy/output_files/Cplus/TestClassCallbacks_Stub.out
-       ../bin/iotpolicy/output_files/Cplus/TestClassComplete_Stub.out
-
-PHONY += folderclean
-folderclean:
-       rm -rf $(BIN_DIR)/iotpolicy/output_files
-
-PHONY += clean
-clean:
-       cd $(BIN_DIR)/iotpolicy/output_files; rm -rf *.class *.gch
-       cd $(BIN_DIR)/iotpolicy/output_files/Java; rm -rf *.class
-       cd $(BIN_DIR)/iotpolicy/output_files/Cplus; rm -rf *.gch
-       cd $(BIN_DIR)/iotpolicy/output_files/Cplus; rm -rf *.out
-
-# 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++/sample
-       #$(G++) iotrmi/C++/sample/TestClass_Stub.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass_Stub.out --std=c++11 -pthread -pg
-       #$(G++) iotrmi/C++/sample/TestClass_Skeleton.cpp -o $(BIN_DIR)/iotrmi/C++/sample/TestClass_Skeleton.out --std=c++11 -pthread -pg
-
-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 += installer
-installer:
-       $(JAVAC)  -d $(BIN_DIR) iotinstaller/*.java
-       cp ../localconfig/iotruntime/MySQLInterface.config $(BIN_DIR)/iotruntime/
-       cp ../localconfig/iotruntime/MySQLInterface.config $(BIN_DIR)/iotinstaller/
-
-PHONY += runtime
-runtime:
-       $(JAVAC) -classpath .:$(RUNTIMEJARS):$(PHONEJARS):$(ZIPJARS) iotruntime/*.java iotruntime/master/*.java iotruntime/slave/*.java iotruntime/messages/*.java iotruntime/stub/*.java iotruntime/zigbee/*.java -d $(BIN_DIR)
-       cp ../localconfig/iotruntime/IoTMaster.config $(BIN_DIR)/iotruntime/
-       cp ../localconfig/iotruntime/IoTSlave.config $(BIN_DIR)/iotruntime/
-       #cp ../others/sslkey/*.jks $(BIN_DIR)/iotruntime/
-       cp -r ../localconfig/mysql $(BIN_DIR)/iotruntime/
-       cp -r ../localconfig/tomoyo $(BIN_DIR)/iotruntime/
-       [ -d $(BIN_DIR)/iotruntime/log ] || mkdir $(BIN_DIR)/iotruntime/log
-
-PHONY += doc
-doc: runtime installer rmi compiler
-       $(JAVADOC) -d $(DOCS_DIR) iotinstaller/*.java iotruntime/*.java iotrmi/*.java iotcompiler/*.java
+       cd $(BIN_DIR)/iotpolicy; $(JAVA) -cp .:..:../$(PARSERJARS):../$(BIN_DIR) iotpolicy.IoTCompiler -cont HomeSecurityController smartthingsactuator.pol smartthingsactuator.req -drv DoorlockActuator smartthingsactuatorcallback.pol smartthingsactuatorcallback.req -drv DoorlockActuator -java Java
 
 .PHONY: $(PHONY)