diff options
Diffstat (limited to 'tools/depends/target/libspdlog/Makefile')
-rw-r--r-- | tools/depends/target/libspdlog/Makefile | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/tools/depends/target/libspdlog/Makefile b/tools/depends/target/libspdlog/Makefile new file mode 100644 index 0000000000..69a396f876 --- /dev/null +++ b/tools/depends/target/libspdlog/Makefile @@ -0,0 +1,69 @@ +-include ../../Makefile.include +DEPS = Makefile + +# lib name, version +LIBNAME=spdlog +VERSION=1.5.0 +SOURCE=$(LIBNAME)-$(VERSION) +ARCHIVE=$(SOURCE).tar.gz + +CMAKE_OPTIONS= \ + -DSPDLOG_BUILD_EXAMPLE=OFF \ + -DSPDLOG_BUILD_TESTS=OFF \ + -DSPDLOG_BUILD_BENCH=OFF \ + -DSPDLOG_INSTALL=ON \ + -DSPDLOG_FMT_EXTERNAL=ON + +ifeq ($(CROSS_COMPILING), yes) + DEPS += ../../Makefile.include +else + CXXFLAGS += -std=c++14 + ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + + ifeq ($(PLATFORM),) + PLATFORM = native + TARBALLS_LOCATION = $(ROOT_DIR) + BASE_URL := http://mirrors.kodi.tv/build-deps/sources + RETRIEVE_TOOL := curl + RETRIEVE_TOOL_FLAGS := -Ls --create-dirs -f -O + ARCHIVE_TOOL := tar + ARCHIVE_TOOL_FLAGS := --strip-components=1 -xf + CMAKE := cmake -DCMAKE_INSTALL_PREFIX=$(PREFIX) + endif +endif + +LIBDYLIB=$(PLATFORM)/build/libspdlog.a + +.PHONY: .installed-native + +all: .installed-$(PLATFORM) + +download: $(TARBALLS_LOCATION)/$(ARCHIVE) + +$(TARBALLS_LOCATION)/$(ARCHIVE): + cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) + +$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) +ifeq ($(PREFIX),) + @echo + @echo "ERROR: please set PREFIX to the kodi install path e.g. make PREFIX=/usr/local" + @exit 1 +endif + rm -rf $(PLATFORM); mkdir -p $(PLATFORM) + cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) + cd $(PLATFORM); rm -rf build; mkdir -p build + cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) .. + +$(LIBDYLIB): $(PLATFORM) + $(MAKE) -C $(PLATFORM)/build + +.installed-$(PLATFORM): $(PLATFORM) + $(MAKE) -C $(PLATFORM)/build install + touch $@ + +clean: + $(MAKE) -C $(PLATFORM)/build clean + rm -f .installed-$(PLATFORM) + +distclean: + rm -rf $(PLATFORM) .installed-$(PLATFORM) |