From ac97fef5eb01215beeb5cb7b6ef20104c6e4fab7 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Thu, 28 May 2020 00:53:48 +0200 Subject: [PATCH] Add DESTDIR --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 034f774..e74095f 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ THREADED_EXAMPLE_FILES := HelloWorldThreaded EchoServerThreaded override CXXFLAGS += -lpthread -Wconversion -std=c++17 -Isrc -IuSockets/src override LDFLAGS += uSockets/*.o -lz +DESTDIR ?= prefix ?= /usr/local # WITH_OPENSSL=1 enables OpenSSL 1.1+ support @@ -34,8 +35,8 @@ examples: $(foreach FILE,$(THREADED_EXAMPLE_FILES),$(CXX) -pthread -flto -O3 $(CXXFLAGS) examples/$(FILE).cpp -o $(FILE) $(LDFLAGS);) install: - mkdir -p "$(prefix)/include/uWebSockets/f2" - cp -r src/* "$(prefix)/include/uWebSockets" + mkdir -p "$(DESTDIR)$(prefix)/include/uWebSockets/f2" + cp -r src/* "$(DESTDIR)$(prefix)/include/uWebSockets" all: $(MAKE) examples