You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vmaf/SOURCES/0001-Use-PREFIX-and-LIBDIR-...

65 lines
2.3 KiB

From 870de42512805dcdd469ef0301476b3fc0e4bc95 Mon Sep 17 00:00:00 2001
From: Nicolas Chauvet <kwizart@gmail.com>
Date: Sat, 7 Apr 2018 12:32:54 +0200
Subject: [PATCH] Use PREFIX and LIBDIR build variable instead of custom ones
---
wrapper/Makefile | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/wrapper/Makefile b/wrapper/Makefile
index 9317515..868b13f 100644
--- a/wrapper/Makefile
+++ b/wrapper/Makefile
@@ -8,7 +8,8 @@ SRCDIR = $(TOP)/src
OBJDIR = $(TOP)/obj
FEATURESRCDIR = $(TOP)/../feature/src
PTOOLSDIR = $(TOP)/../ptools
-INSTALL_PREFIX = /usr/local
+PREFIX ?= /usr/local
+LIBDIR ?= $(PREFIX)/lib
INCLUDES += -I$(TOP)/../feature/src
INCLUDES += -I$(TOP)/../feature/src/common
@@ -168,24 +169,24 @@ vmafossexec: $(OBJDIR)/main.o $(LIBVMAF)
.PHONY: install
install:
- mkdir -p $(DESTDIR)$(INSTALL_PREFIX)/lib
- mkdir -p $(DESTDIR)$(INSTALL_PREFIX)/include
- mkdir -p $(DESTDIR)$(INSTALL_PREFIX)/share
- mkdir -p $(DESTDIR)$(INSTALL_PREFIX)/lib/pkgconfig
- cp $(LIBVMAF) $(DESTDIR)$(INSTALL_PREFIX)/lib/$(LIBVMAF)
- cp src/libvmaf.h $(DESTDIR)$(INSTALL_PREFIX)/include/
- cp -r ../model $(DESTDIR)$(INSTALL_PREFIX)/share/
- cp libvmaf.pc $(DESTDIR)$(INSTALL_PREFIX)/lib/pkgconfig/
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ mkdir -p $(DESTDIR)$(PREFIX)/include
+ mkdir -p $(DESTDIR)$(PREFIX)/share
+ mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
+ cp $(LIBVMAF) $(DESTDIR)$(LIBDIR)/$(LIBVMAF)
+ cp src/libvmaf.h $(DESTDIR)$(PREFIX)/include/
+ cp -r ../model $(DESTDIR)$(PREFIX)/share/
+ cp libvmaf.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
.PHONY: uninstall
uninstall:
- rm -f $(DESTDIR)$(INSTALL_PREFIX)/lib/$(LIBVMAF)
- rm -f $(DESTDIR)$(INSTALL_PREFIX)/include/libvmaf.h
- rm -fr $(DESTDIR)$(INSTALL_PREFIX)/share/model
- rm -f $(DESTDIR)$(INSTALL_PREFIX)/lib/pkgconfig/libvmaf.pc
+ rm -f $(DESTDIR)$(LIBDIR)/$(LIBVMAF)
+ rm -f $(DESTDIR)$(PREFIX)/include/libvmaf.h
+ rm -fr $(DESTDIR)$(PREFIX)/share/model
+ rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/libvmaf.pc
testlib: $(SRCDIR)/main.cpp
- $(CXX) -s -o $@ $(CXXFLAGS) $^ -I $(FEATURESRCDIR) -I $(FEATURESRCDIR)/common -I $(DESTDIR)$(INSTALL_PREFIX)/include -L$(DESTDIR)$(INSTALL_PREFIX)/lib -lvmaf -pthread
+ $(CXX) -s -o $@ $(CXXFLAGS) $^ -I $(FEATURESRCDIR) -I $(FEATURESRCDIR)/common -I $(DESTDIR)$(PREFIX)/include -L$(DESTDIR)$(LIBDIR) -lvmaf -pthread
.PHONY: clean
clean:
--
2.17.2