Fix misuse of DESTDIR and PREFIX in Makefile

This commit is contained in:
Grégory Soutadé 2023-08-08 20:11:33 +02:00
parent e06d20a392
commit 9a75213b49
2 changed files with 7 additions and 10 deletions

View File

@ -1,13 +1,10 @@
LIBDIR ?= /usr/lib PREFIX ?= /usr/local
INCDIR ?= /usr/include LIBDIR ?= /lib
INCDIR ?= /include
AR ?= $(CROSS)ar AR ?= $(CROSS)ar
CXX ?= $(CROSS)g++ CXX ?= $(CROSS)g++
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
UPDFPARSERLIB = ./lib/updfparser/libupdfparser.a UPDFPARSERLIB = ./lib/updfparser/libupdfparser.a
CXXFLAGS += -Wall -fPIC -I./include -I./usr/include/pugixml -I./lib/updfparser/include 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 $^ $@ ln -f -s $^ $@
build_utils: $(TARGET_LIBRARIES) 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: $(TARGET_LIBRARIES)
install -d $(DESTDIR)$(PREFIX)$(LIBDIR) install -d $(DESTDIR)$(PREFIX)$(LIBDIR)
# Use cp to preserver symlinks # Use cp to preserver symlinks
cp --no-dereference $(TARGET_LIBRARIES) $(DESTDIR)$(PREFIX)$(LIBDIR) 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: uninstall:
cd $(DESTDIR)$(PREFIX)/$(LIBDIR) cd $(DESTDIR)$(PREFIX)/$(LIBDIR)

View File

@ -1,5 +1,5 @@
BINDIR ?= /usr/bin BINDIR ?= /bin
MANDIR ?= /usr/share/man MANDIR ?= /share/man
TARGET_BINARIES=acsmdownloader adept_activate adept_remove adept_loan_mgt TARGET_BINARIES=acsmdownloader adept_activate adept_remove adept_loan_mgt
TARGETS=$(TARGET_BINARIES) launcher TARGETS=$(TARGET_BINARIES) launcher