1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/ccn-lite/Makefile
2021-12-03 10:12:32 +01:00

47 lines
1.3 KiB
Makefile

PKG_NAME=ccn-lite
PKG_URL=https://github.com/cn-uofbasel/ccn-lite/
PKG_VERSION=da0d9de8d82349dff845acc62d37242dd09b3d3d
PKG_LICENSE=ISC
include $(RIOTBASE)/pkg/pkg.mk
.PHONY: ..cmake_version_supported
CMAKE_MINIMAL_VERSION = 3.6.0
RIOT_CFLAGS = $(INCLUDES)
ifeq (llvm,$(TOOLCHAIN))
RIOT_CFLAGS += -Wno-char-subscripts
endif
TOOLCHAIN_FILE = $(PKG_SOURCE_DIR)/xcompile-toolchain.cmake
CFLAGS += -Wno-cast-align
all: $(BINDIR)/ccn-lite.a
$(BINDIR)/ccn-lite.a: $(PKG_BUILD_DIR)/lib/libccnl-riot.a
cp $< $@
$(PKG_BUILD_DIR)/lib/libccnl-riot.a: $(PKG_BUILD_DIR)/Makefile
$(MAKE) -C $(PKG_BUILD_DIR)
$(PKG_BUILD_DIR)/Makefile: $(PKG_PREPARED) $(TOOLCHAIN_FILE) | ..cmake_version_supported
cmake -B$(PKG_BUILD_DIR) -H$(PKG_SOURCE_DIR)/src \
-DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
-DCCNL_RIOT=1 -DRIOT_CFLAGS="$(RIOT_CFLAGS)" -DBUILD_TESTING=OFF
$(TOOLCHAIN_FILE): FORCE
$(RIOTTOOLS)/cmake/generate-xcompile-toolchain.sh > $(TOOLCHAIN_FILE)
..cmake_version_supported:
@ # Remove '-rcX' from version as they are not well handled
$(Q)\
CMAKE_VERSION=$$(cmake --version | sed -n '1 {s/cmake version //;s/-rc.*//;p;}'); \
$(RIOTTOOLS)/has_minimal_version/has_minimal_version.sh "$${CMAKE_VERSION}" "$(CMAKE_MINIMAL_VERSION)" cmake
ifneq (,$(filter -Wformat-nonliteral -Wformat=2, $(CFLAGS)))
CFLAGS += -Wno-format-nonliteral
endif