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=debug`
22 # default to release build
29 # You must create the file "local.properties" on your local machine which contains any local paths, etc
30 # local.properties should NOT be committed to repo
31 include $(ROOT_DIR)/../csdk/local.properties
32 # GTEST_DIR contains the path to Google Test libs and must be defined in local.properties
34 # GTEST_DIR := /home/johndoe/utils/gtest-1.7.0
36 # NOTE: to run app, make sure that LD_LIBRARY_PATH env variable
37 # contains $(GTEST_DIR)/lib/.libs
41 INC_DIRS := -I../include/
42 INC_DIRS += -I../oc_logger/include
43 INC_DIRS += -I../csdk/stack/include
44 INC_DIRS += -I../csdk/ocsocket/include
45 INC_DIRS += -I../csdk/ocrandom/include
46 INC_DIRS += -I../csdk/logger/include
47 INC_DIRS += -I../csdk/libcoap
48 INC_DIRS += -I$(GTEST_DIR)/include
50 LIB_OC_LOGGER := ../oc_logger/lib/oc_logger.a
52 CXX_LIBS := ../$(BUILD)/obj/liboc.a ../csdk/$(PLATFORM)/$(BUILD)/liboctbstack.a $(LIB_OC_LOGGER)
53 CXX_LIBS += $(GTEST_DIR)/lib/.libs/libgtest.a $(GTEST_DIR)/lib/.libs/libgtest_main.a
55 CC_FLAGS.debug := -g -O0 -g3 -Wall -ffunction-sections -fdata-sections \
56 -std=c++0x -pedantic $(INC_DIRS) -L$(ROOT_DIR)/$(BUILD) -DTB_LOG
57 CC_FLAGS.release := -Os -Wall -fdata-sections -Wl,--gc-sections -Wl,-s \
58 -std=c++0x $(INC_DIRS) -L$(ROOT_DIR)/$(BUILD)
60 CPPFLAGS += $(CC_FLAGS.$(BUILD)) $(CXX_LIBS) -lpthread
68 $(CXX) $^ $(CPPFLAGS) -o $(OUT_DIR)/$@