1 # //******************************************************************
3 # // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 # // Licensed under the Apache License, Version 2.0 (the "License");
8 # // you may not use this file except in compliance with the License.
9 # // You may obtain a copy of the License at
11 # // http://www.apache.org/licenses/LICENSE-2.0
13 # // Unless required by applicable law or agreed to in writing, software
14 # // distributed under the License is distributed on an "AS IS" BASIS,
15 # // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # // See the License for the specific language governing permissions and
17 # // limitations under the License.
19 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 # override with `make BUILD=release`
22 # default to release build
29 DEPEND_DIR:= ../dependencies
30 CEREAL_DIR:= $(DEPEND_DIR)/cereal
32 CXX_FLAGS.debug := -O0 -g3 -std=c++0x -Wall -pthread
34 CXX_FLAGS.release := -O3 -std=c++0x -Wall -pthread
36 CXX_INC := -I../include/
37 CXX_INC += -I../oc_logger/include
38 CXX_INC += -I../csdk/stack/include
39 CXX_INC += -I../csdk/ocsocket/include
40 CXX_INC += -I../csdk/ocrandom/include
41 CXX_INC += -I../csdk/logger/include
42 CXX_INC += -I../csdk/libcoap
43 CXX_INC += -I$(CEREAL_DIR)/include
45 LIB_OC_LOGGER := ../oc_logger/lib/oc_logger.a
47 CXX_LIBS := ../$(BUILD)/obj/liboc.a ../csdk/$(PLATFORM)/$(BUILD)/liboctbstack.a $(LIB_OC_LOGGER)
49 # Force metatargets to build:
50 all.PHONY: prep_dirs oc_cpp_sdk simpleserver simpleserverHQ simpleclient simpleclientHQ simpleclientserver roomserver roomclient presenceserver presenceclient garageserver garageclient fridgeserver fridgeclient ocicuc_target threadingsample
52 apps.PHONY: prep_dirs oc_cpp_sdk simpleserver simpleserverHQ simpleclient simpleclientHQ simpleclientserver roomserver roomclient presenceserver presenceclient garageserver garageclient fridgeserver fridgeclient threadingsample
54 buildScript_all.PHONY: prep_dirs simpleserver simpleserverHQ simpleclient simpleclientHQ simpleclientserver roomserver roomclient presenceserver presenceclient garageserver garageclient fridgeserver fridgeclient threadingsample
60 buildScript_all: buildScript_all.PHONY
66 cd ../ && $(MAKE) cpp_sdk "BUILD=$(BUILD)"
68 simpleserver: simpleserver.cpp
69 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ simpleserver.cpp $(CXX_INC) $(CXX_LIBS)
71 simpleserverHQ: simpleserverHQ.cpp
72 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ simpleserverHQ.cpp $(CXX_INC) $(CXX_LIBS)
74 simpleclientHQ: simpleclientHQ.cpp
75 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ simpleclientHQ.cpp $(CXX_INC) $(CXX_LIBS)
77 simpleclient: simpleclient.cpp
78 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ simpleclient.cpp $(CXX_INC) $(CXX_LIBS)
80 fridgeserver: fridgeserver.cpp
81 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ fridgeserver.cpp $(CXX_INC) $(CXX_LIBS)
83 fridgeclient: fridgeclient.cpp
84 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ fridgeclient.cpp $(CXX_INC) $(CXX_LIBS)
86 presenceserver: presenceserver.cpp
87 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ presenceserver.cpp $(CXX_INC) $(CXX_LIBS)
89 presenceclient: presenceclient.cpp
90 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ presenceclient.cpp $(CXX_INC) $(CXX_LIBS)
92 simpleclientserver: simpleclientserver.cpp
93 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ simpleclientserver.cpp $(CXX_INC) $(CXX_LIBS)
95 roomserver: roomserver.cpp
96 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ roomserver.cpp $(CXX_INC) $(CXX_LIBS)
98 roomclient: roomclient.cpp
99 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ roomclient.cpp $(CXX_INC) $(CXX_LIBS)
101 garageserver: garageserver.cpp
102 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ garageserver.cpp $(CXX_INC) $(CXX_LIBS)
104 garageclient: garageclient.cpp
105 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ garageclient.cpp $(CXX_INC) $(CXX_LIBS)
107 threadingsample: threadingsample.cpp
108 $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ threadingsample.cpp $(CXX_INC) $(CXX_LIBS)
111 cd ocicuc && $(MAKE) apps
116 cd ../ && $(MAKE) clean_cpp_sdk
117 cd ocicuc && $(MAKE) clean
118 cd ocicuc && $(MAKE) clean_apps
123 cd ocicuc && $(MAKE) clean
124 cd ocicuc && $(MAKE) clean_apps