]> git.sesse.net Git - plocate/commitdiff
Support setting LDFLAGS.
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Sun, 4 Oct 2020 22:35:18 +0000 (00:35 +0200)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Sun, 4 Oct 2020 22:35:18 +0000 (00:35 +0200)
Makefile

index 9fb360f44a2475a3b99bcb93b0ddf70e594cd80d..f8dcc6d246e7033d6e010c5bb0b2b6f415cc5818 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@ CC ?= gcc
 CXX ?= g++
 CXXFLAGS ?= -O2 -g -Wall -std=gnu++17
 CPPFLAGS=-ITurboPFor-Integer-Compression/
+LDFLAGS ?=
 INSTALL ?= install
 PREFIX ?= /usr/local
 URING_LIBS = $(shell pkg-config --libs liburing)
@@ -13,10 +14,10 @@ endif
 all: plocate plocate-build
 
 plocate: plocate.o io_uring_engine.o TurboPFor-Integer-Compression/libic.a
-       $(CXX) -o $@ $^ -lzstd $(URING_LIBS)
+       $(CXX) -o $@ $^ -lzstd $(URING_LIBS) $(LDFLAGS)
 
 plocate-build: plocate-build.o TurboPFor-Integer-Compression/libic.a
-       $(CXX) -o $@ $^ -lzstd
+       $(CXX) -o $@ $^ -lzstd $(LDFLAGS)
 
 TurboPFor-Integer-Compression/libic.a:
        cd TurboPFor-Integer-Compression/ && $(MAKE)
@@ -33,6 +34,6 @@ install: all
 bench.o: bench.cpp turbopfor.h
 
 bench: bench.o io_uring_engine.o TurboPFor-Integer-Compression/libic.a
-       $(CXX) -o $@ $^ $(URING_LIBS)
+       $(CXX) -o $@ $^ $(URING_LIBS) $(LDFLAGS)
 
 .PHONY: clean install