From 9a75213b4957d0c906c5b9cfdcb35b3b2aa5ad61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Tue, 8 Aug 2023 20:11:33 +0200 Subject: [PATCH] Fix misuse of DESTDIR and PREFIX in Makefile --- Makefile | 13 +++++-------- utils/Makefile | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index ceaf392..31e9b6b 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,10 @@ -LIBDIR ?= /usr/lib -INCDIR ?= /usr/include +PREFIX ?= /usr/local +LIBDIR ?= /lib +INCDIR ?= /include AR ?= $(CROSS)ar CXX ?= $(CROSS)g++ -ifeq ($(PREFIX),) - PREFIX := /usr/local -endif - UPDFPARSERLIB = ./lib/updfparser/libupdfparser.a CXXFLAGS += -Wall -fPIC -I./include -I./usr/include/pugixml -I./lib/updfparser/include @@ -86,13 +83,13 @@ libgourou.so: libgourou.so.$(VERSION) ln -f -s $^ $@ build_utils: $(TARGET_LIBRARIES) - $(MAKE) -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) DEST_DIR=$(DEST_DIR) PREFIX=$(PREFIX) + $(MAKE) -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) install: $(TARGET_LIBRARIES) install -d $(DESTDIR)$(PREFIX)$(LIBDIR) # Use cp to preserver symlinks cp --no-dereference $(TARGET_LIBRARIES) $(DESTDIR)$(PREFIX)$(LIBDIR) - $(MAKE) -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) DEST_DIR=$(DEST_DIR) PREFIX=$(PREFIX) install + $(MAKE) -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) install uninstall: cd $(DESTDIR)$(PREFIX)/$(LIBDIR) diff --git a/utils/Makefile b/utils/Makefile index ee77ad5..5fa5fe2 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,5 +1,5 @@ -BINDIR ?= /usr/bin -MANDIR ?= /usr/share/man +BINDIR ?= /bin +MANDIR ?= /share/man TARGET_BINARIES=acsmdownloader adept_activate adept_remove adept_loan_mgt TARGETS=$(TARGET_BINARIES) launcher