Makefile.tomove 1.55 KB
IOTIVITY_CFLAGS = -std=gnu99 -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -Wall -Wno-format-zero-length -Wno-main -ffreestanding -Os -fno-stack-protector -ffunction-sections -fdata-sections -Wno-unused-but-set-variable -fno-reorder-functions -fno-defer-pop -Wno-pointer-sign -fno-strict-overflow -Werror=implicit-int

CBOR = ./deps/tinycbor/src/cborencoder.c ./deps/tinycbor/src/cborencoder_close_container_checked.c ./deps/tinycbor/src/cborparser.c

DTLS = ./deps/tinydtls/ccm.c  ./deps/tinydtls/hmac.c  ./deps/tinydtls/netq.c  ./deps/tinydtls/peer.c  ./deps/tinydtls/dtls_time.c  ./deps/tinydtls/session.c  ./deps/tinydtls/sha2/sha2.c  ./deps/tinydtls/ecc/ecc.c  ./deps/tinydtls/aes/rijndael.c  ./deps/tinydtls/crypto.c  ./deps/tinydtls/dtls.c

DTLSFLAGS = -DDTLSV12 -DWITH_SHA256 -DDTLS_CHECK_CONTENTTYPE -DWITH_OCF -I./deps/tinydtls -DNDEBUG

SRC_DEPS = ${CBOR}
SRC_CORE = $(wildcard ./messaging/coap/*.c ./api/*.c ./util/*.c ./util/pt/*.c)
VPATH=./util/pt:./messaging/coap/:./util/:./api/:./deps/tinycbor/src/:
SRC_PORT = $(wildcard ./port/riot/*.c)

ifeq ($(SECURE),1)
	SRC_SECURE += $(wildcard ./security/*.c)
	SRC_DEPS += ${DTLS}
	CFLAGS += ${DTLSFLAGS} -DOC_SECURITY
	VPATH += ./security/:./deps/tinydtls/:./deps/tinydtls/aes/:./deps/tinydtls/sha2/:./deps/tinydtls/ecc/:
endif


SRC = ${SRC_DEPS} ${SRC_PORT} ${SRC_CORE}

ifeq ($(SECURE),1)
	SRC += ${SRC_SECURE}
endif

OBJ = $(SRC:.c=.o)



lib-iotivity.a: ${OBJ}
	@${AR} rcs $@ ${OBJ}

$(OBJ): %.o: %.c
	@${CC} -o $@ ${RIOT_CFLAGS} ${IOTIVITY_CFLAGS} -c $<

clean: clean_iotivity

clean_iotivity:
	rm -rf ${OBJ}