1 #other options are android, arduino
5 OCSOCK_DIR = $(ROOT_DIR)/ocsocket
6 LOGGER_DIR = $(ROOT_DIR)/logger
7 RANDOM_DIR = $(ROOT_DIR)/ocrandom
8 CJSON_DIR = $(ROOT_DIR)/../../../ccf-utilities/tb/cJSON
9 INC_DIRS = -I$(OCSOCK_DIR)/include/ -I$(LOGGER_DIR)/include -I$(RANDOM_DIR)/include -I$(CJSON_DIR)
11 ifeq ($(PLATFORM),android)
12 CCPLUS=arm-linux-androideabi-g++
13 CC=arm-linux-androideabi-gcc
14 AR=arm-linux-androideabi-ar
15 RANLIB=arm-linux-androideabi-ranlib
16 CFLAGS_ANDROID = -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
17 LDFLAGS_ANDROID = -march=armv7-a -Wl,--fix-cortex-a8 -llog
18 else ifeq ($(PLATFORM),linux)
24 $(error Wrong value for PLATFORM !!)
27 CFLAGS += -Os -Wall -Wno-write-strings -ffunction-sections -fdata-sections -fno-exceptions \
28 -Wextra -Wno-variadic-macros -pedantic -std=gnu99 -DWITH_POSIX -DTB_LOG
30 SUBDIRS:= examples doc
32 SOURCES:= pdu.c net.c debug.c encode.c uri.c coap_list.c resource.c hashkey.c \
33 str.c option.c async.c subscribe.c block.c ocsocket.c logger.c \
36 OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
38 VPATH = $(OCSOCK_DIR)/src:$(LOGGER_DIR)/src:$(RANDOM_DIR)/src:$(CJSON_DIR)
41 $(CC) -c $(CFLAGS) $(CFLAGS_ANDROID) $(INC_DIRS) $< -o $@
44 $(MAKE) -C examples all
51 $(MAKE) -C examples install
60 for dir in $(SUBDIRS); do \
61 $(MAKE) -C $$dir clean ; \