Adjustments and clean-ups for Makefile for C++ benchmark and drivers
[iot2.git] / benchmarks / drivers / Cpp / Makefile
index a14df948cb0eac3d9a8ceb1415912143c956e1f9..d531d5af71b1bded2c408da2b22f69768f748b25 100644 (file)
@@ -2,13 +2,46 @@ BASE = ../../..
 
 include $(BASE)/common.mk
 
-all: light
+all: so-light-arm so-lightskel-arm lightzip so-labroom-arm so-labroomskel-arm labroomzip
+
+ARGS = -shared -fpic
 
 # Compile
 #
-PHONY += light
-light:
-       cd LifxLightBulb/; $(G++) ./LifxLightBulb.cpp $(BASE)/../iotjava/iotruntime/cpp/socket/Socket.cpp -o ../$(BIN_DIR)/iotcode/LifxLightBulb/LifxLightBulb.o --std=c++11 -pthread -pg -I$(BASE)/../iotjava/iotruntime/cpp/ -I$(BASE)/../iotjava/iotruntime/cpp/socket/ -I$(BASE)/../iotjava/iotruntime/cpp/setrelation/ -I$(BASE)/../iotjava/iotrmi/C++/ -I$(BASE)/../benchmarks/virtuals/
+# LightBulb
+
+# LifxLightBulb .so file will be generated for ARM (Raspberry Pi)
+PHONY += so-light-arm
+so-light-arm:
+       cd LifxLightBulb/; $(ARM_G++) $(ARGS) ./LifxLightBulb.cpp $(BASE)/../iotjava/iotruntime/cpp/socket/Socket.cpp -o ../$(BIN_DIR)/iotcode/LifxLightBulb/LifxLightBulb.so --std=c++11 -pthread -pg -I$(BASE)/../iotjava/iotruntime/cpp/ -I$(BASE)/../iotjava/iotruntime/cpp/socket/ -I$(BASE)/../iotjava/iotruntime/cpp/setrelation/ -I$(BASE)/../iotjava/iotrmi/C++/ -I$(BASE)/../benchmarks/virtuals/
        cp LifxLightBulb/LifxLightBulb.config $(BIN_DIR)/iotcode/LifxLightBulb
 
+# LifxLightBulb skeleton .so file will be generated for ARM (Raspberry Pi)
+PHONY += so-lightskel-arm
+so-lightskel-arm:
+       cd LifxLightBulb/; $(ARM_G++) $(ARGS) ./LightBulb_Skeleton.cpp $(BASE)/../iotjava/iotruntime/cpp/socket/Socket.cpp -o ../$(BIN_DIR)/iotcode/LifxLightBulb/LightBulb_Skeleton.so --std=c++11 -pthread -pg -I$(BASE)/../iotjava/iotruntime/cpp/ -I$(BASE)/../iotjava/iotruntime/cpp/socket/ -I$(BASE)/../iotjava/iotruntime/cpp/setrelation/ -I$(BASE)/../iotjava/iotrmi/C++/ -I$(BASE)/../benchmarks/virtuals/
+       cp LifxLightBulb/LifxLightBulb.config $(BIN_DIR)/iotcode/LifxLightBulb
+
+PHONY += lightzip
+lightzip:
+       cd  $(BIN_DIR)/iotcode/LifxLightBulb/; zip -r LifxLightBulb.zip *.so
+
+# LabRoom
+
+# LabRoom .so file will be generated for ARM (Raspberry Pi)
+PHONY += so-labroom-arm
+so-labroom-arm:
+       cd LabRoom/; $(ARM_G++) $(ARGS) ./LabRoom.cpp $(BASE)/../iotjava/iotruntime/cpp/socket/Socket.cpp -o ../$(BIN_DIR)/iotcode/LabRoom/LabRoom.so --std=c++11 -pthread -pg -I$(BASE)/../iotjava/iotruntime/cpp/ -I$(BASE)/../iotjava/iotruntime/cpp/socket/ -I$(BASE)/../iotjava/iotruntime/cpp/setrelation/ -I$(BASE)/../iotjava/iotrmi/C++/ -I$(BASE)/../benchmarks/virtuals/
+       cp LabRoom/LabRoom.config $(BIN_DIR)/iotcode/LabRoom
+
+# LabRoom skeleton .so file will be generated for ARM (Raspberry Pi)
+PHONY += so-labroomskel-arm
+so-labroomskel-arm:
+       cd LabRoom/; $(ARM_G++) $(ARGS) ./Room_Skeleton.cpp $(BASE)/../iotjava/iotruntime/cpp/socket/Socket.cpp -o ../$(BIN_DIR)/iotcode/LabRoom/Room_Skeleton.so --std=c++11 -pthread -pg -I$(BASE)/../iotjava/iotruntime/cpp/ -I$(BASE)/../iotjava/iotruntime/cpp/socket/ -I$(BASE)/../iotjava/iotruntime/cpp/setrelation/ -I$(BASE)/../iotjava/iotrmi/C++/ -I$(BASE)/../benchmarks/virtuals/
+       cp LabRoom/LabRoom.config $(BIN_DIR)/iotcode/LabRoom
+
+PHONY += labroomzip
+labroomzip:
+       cd  $(BIN_DIR)/iotcode/LabRoom/; zip -r LabRoom.zip *.so
+
 .PHONY: $(PHONY)