Adjusting C++ files to compile with gcc 4.9.3
[iot2.git] / benchmarks / Cpp / Lifxtest / Makefile
index 3dd8e5caa9b9b792a4c51445cd920887cb29d62c..38a378a88307360e791685b4a56bcc6927b954b1 100755 (executable)
@@ -2,11 +2,48 @@ BASE = ../../..
 
 include $(BASE)/common.mk
 
-all: lifxtest
+all: so-lifxtest so-lightstub so-roomstub zip
 
-PHONY += lifxtest
-lifxtest:
-       $(G++) ./Lifxtest.cpp $(BASE)/iotjava/iotruntime/cpp/socket/Socket.cpp -o $(BIN_DIR)/Lifxtest/Lifxtest.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/ -I$(BASE)/benchmarks/drivers/Cpp/LifxLightBulb/
+ARGS = -shared -fpic
+
+# Lifxtest .so file will be generated for ARM (Raspberry Pi)
+PHONY += so-lifxtest
+so-lifxtest:
+       $(G++) $(ARGS) ./Lifxtest.cpp $(BASE)/iotjava/iotruntime/cpp/socket/Socket.cpp -o $(BIN_DIR)/Lifxtest/Lifxtest.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/ -I$(BASE)/benchmarks/drivers/Cpp/LifxLightBulb/ -I$(BASE)/benchmarks/drivers/Cpp/LabRoom/
+       cp ./Lifxtest.config $(BIN_DIR)/Lifxtest
+
+# Lifxtest .so file will be generated for ARM (Raspberry Pi) using a cross-compiler
+PHONY += so-lifxtest-arm
+so-lifxtest-arm:
+       $(ARM_G++) $(ARGS) ./Lifxtest.cpp $(BASE)/iotjava/iotruntime/cpp/socket/Socket.cpp -o $(BIN_DIR)/Lifxtest/Lifxtest.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/ -I$(BASE)/benchmarks/drivers/Cpp/LifxLightBulb/ -I$(BASE)/benchmarks/drivers/Cpp/LabRoom/
+       cp ./Lifxtest.config $(BIN_DIR)/Lifxtest
+
+# Light stub .so file will be generated for ARM (Raspberry Pi)
+PHONY += so-lightstub
+so-lightstub:
+       $(G++) $(ARGS) ./LightBulbTest_Stub.cpp $(BASE)/iotjava/iotruntime/cpp/socket/Socket.cpp -o $(BIN_DIR)/Lifxtest/LightBulbTest_Stub.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 ./Lifxtest.config $(BIN_DIR)/Lifxtest
+
+# Light stub .so file will be generated for ARM (Raspberry Pi) using a cross-compiler
+PHONY += so-lightstub-arm
+so-lightstub-arm:
+       $(ARM_G++) $(ARGS) ./LightBulbTest_Stub.cpp $(BASE)/iotjava/iotruntime/cpp/socket/Socket.cpp -o $(BIN_DIR)/Lifxtest/LightBulbTest_Stub.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 ./Lifxtest.config $(BIN_DIR)/Lifxtest
+
+# Room stub .so file will be generated for ARM (Raspberry Pi)
+PHONY += so-roomstub
+so-roomstub:
+       $(G++) $(ARGS) ./RoomSmart_Stub.cpp $(BASE)/iotjava/iotruntime/cpp/socket/Socket.cpp -o $(BIN_DIR)/Lifxtest/RoomSmart_Stub.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 ./Lifxtest.config $(BIN_DIR)/Lifxtest
 
+# Room stub .so file will be generated for ARM (Raspberry Pi) using a cross-compiler
+PHONY += so-roomstub-arm
+so-roomstub-arm:
+       $(ARM_G++) $(ARGS) ./RoomSmart_Stub.cpp $(BASE)/iotjava/iotruntime/cpp/socket/Socket.cpp -o $(BIN_DIR)/Lifxtest/RoomSmart_Stub.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 ./Lifxtest.config $(BIN_DIR)/Lifxtest
+
+PHONY += zip
+zip:
+       cd  $(BIN_DIR)/Lifxtest; zip -r Lifxtest.zip *.so
+
 .PHONY: $(PHONY)