Fix build error on gcc version 7.x
[platform/upstream/iotivity.git] / examples / OICSensorBoard / Makefile
index 8a6939b..21c9068 100644 (file)
@@ -1,16 +1,29 @@
+default: all
+
 #Set the two variables below for the client build.
-CLIENTARCH=x86
-BUILDTYPE=release
+CLIENTARCH?=x86
+BUILDTYPE?=release
 ##
 
 YOCTOCXXFLAGS=-I$(SDKTARGETSYSROOT)/usr/include/iotivity/resource/ -I$(SDKTARGETSYSROOT)/usr/include/iotivity/resource/stack -I$(SDKTARGETSYSROOT)/usr/include/iotivity/resource/ocrandom -I$(SDKTARGETSYSROOT)/usr/include/iotivity/resource/logger -I$(SDKTARGETSYSROOT)/usr/include/iotivity/resource/oc_logger
 
 YOCTOLDFLAGS=-loc -loctbstack -loc_logger -lmraa
 
-CXXFLAGS=-I../../resource/include -I../../resource/csdk/stack/include -I../../resource/csdk/ocrandom/include -I../../resource/csdk/logger/include -I../../resource/oc_logger/include
+CXXFLAGS=-I../../resource/include -I../../resource/c_common -I../../resource/csdk/stack/include -I../../resource/c_common/ocrandom/include -I../../resource/csdk/logger/include -I../../resource/oc_logger/include
 
 LDFLAGS=-L../../out/linux/$(CLIENTARCH)/$(BUILDTYPE) -loc -loctbstack -loc_logger
 
+install_dir?=${DESTDIR}/usr/lib/iotivity/examples/OICSensorBoard
+
+exes?=client
+ifneq ($(SDKTARGETSYSROOT),)
+exes+=server
+endif
+
+
+all: client
+       @echo "server depends on mraa"
+
 client: client.o
        g++ -o client client.o $(LDFLAGS)
 
@@ -32,3 +45,7 @@ server: server.o observer.o
 
 clean:
        rm -rf server client *.o
+
+install: ${exes}
+       install -d ${install_dir}
+       install $^ ${install_dir}