diff options
author | montellese <montellese@xbmc.org> | 2015-08-03 14:07:46 +0200 |
---|---|---|
committer | montellese <montellese@kodi.tv> | 2015-08-10 18:17:44 +0200 |
commit | 6f8171f53992fc2eaabf71f6fa47ebed1da0d43d (patch) | |
tree | bc506b674ce3ebb3c29c123a3cb75aff79bb9279 /tools/depends/target/crossguid | |
parent | fe837c4eab8f2776ac3980a243ae419fef5b1119 (diff) |
[depends] integrate crossguid as a static library
Diffstat (limited to 'tools/depends/target/crossguid')
-rw-r--r-- | tools/depends/target/crossguid/Makefile | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/tools/depends/target/crossguid/Makefile b/tools/depends/target/crossguid/Makefile new file mode 100644 index 0000000000..dedcd74764 --- /dev/null +++ b/tools/depends/target/crossguid/Makefile @@ -0,0 +1,71 @@ +-include ../../Makefile.include +DEPS = Makefile + +# lib name, version +LIBNAME=crossguid +VERSION=8f399e8bd4 +SOURCE=$(LIBNAME)-$(VERSION) +ARCHIVE=$(SOURCE).tar.gz + + +ifeq ($(CROSS_COMPILING), yes) + DEPS += ../../Makefile.include +else + CXXFLAGS += -std=c++11 + 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 -Ls --create-dirs -f -O + ARCHIVE_TOOL := tar --strip-components=1 -xf + endif +endif + + +# define specifying the native GUID implementation to use +GUID_PLATFORM_DEFINE=GUID_LIBUUID +ifeq ($(OS),android) + GUID_PLATFORM_DEFINE=GUID_ANDROID +endif +ifeq ($(OS),osx) + GUID_PLATFORM_DEFINE=GUID_CFUUID +endif +ifeq ($(OS),ios) + GUID_PLATFORM_DEFINE=GUID_CFUUID +endif + +LIBDYLIB=$(PLATFORM)/lib$(LIBNAME).a + +all: .installed-$(PLATFORM) + +$(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) + +$(LIBDYLIB): $(PLATFORM) + cd $(PLATFORM); $(CXX) -c guid.cpp -o guid.o $(CXXFLAGS) -D$(GUID_PLATFORM_DEFINE) + cd $(PLATFORM); $(AR) rvs lib$(LIBNAME).a guid.o + +.installed-$(PLATFORM): $(LIBDYLIB) + @[ -d $(PREFIX)/include ] || mkdir -p $(PREFIX)/include + @[ -d $(PREFIX)/lib ] || mkdir $(PREFIX)/lib + cp $(PLATFORM)/guid.h $(PREFIX)/include/ + cp $(LIBDYLIB) $(PREFIX)/lib/ + touch $@ + +clean: + rm -rf $(PLATFORM) .installed-$(PLATFORM) + +distclean:: + rm -rf $(PLATFORM) .installed-$(PLATFORM) + |