Skip to content

Instantly share code, notes, and snippets.

@un1versal
Last active February 29, 2016 16:43
Show Gist options
  • Save un1versal/8350279 to your computer and use it in GitHub Desktop.
Save un1versal/8350279 to your computer and use it in GitHub Desktop.
libnfs 1.10.0 makefile for kodi
# A quick and dirty Makefile to download/build and install
#
# Usage:
# make
# sudo make install
# lib name, version
LIBNAME=libnfs
VERSION=1.10.0
SOURCE=$(LIBNAME)-$(VERSION)
# download location and format
BASE_URL=https://sites.google.com/site/libnfstarballs/li
ARCHIVE=$(SOURCE).tar.gz
TARBALLS_LOCATION=.
RETRIEVE_TOOL=/usr/bin/curl
RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(TARBALLS_LOCATION)/$(ARCHIVE)
ARCHIVE_TOOL=tar
ARCHIVE_TOOL_FLAGS=-xf
PREFIX ?= /usr
LIBNFS_CONFIGOPTS ?= --prefix=$(PREFIX)
# configuration settings
CONFIGURE=./configure $(LIBNFS_CONFIGOPTS)
SO_NAME=$(SOURCE)/lib/libnfs.so
CLEAN_FILES=$(ARCHIVE) $(SOURCE)
all: $(SO_NAME)
$(TARBALLS_LOCATION)/$(ARCHIVE):
$(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
rm -rf $(SOURCE)
$(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
echo $(SOURCE) > .gitignore
cd $(SOURCE);./bootstrap;$(CONFIGURE)
$(SO_NAME): $(SOURCE)
make -C $(SOURCE)
install:
make -C $(SOURCE) install
clean:
make -C $(SOURCE) clean
rm -f .installed
rm -f -r include
rm -f -r lib
rm -f *.tar.gz
rm -r -f nfsc
distclean::
rm -rf $(SOURCE) .installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment