2022-06-06 10:16:20 +05:30
|
|
|
PCRE2_VERSION = 10.40
|
|
|
|
PCRE2_SOURCES = https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$(PCRE2_VERSION)/pcre2-$(PCRE2_VERSION).tar.gz
|
|
|
|
PCRE2_TARBALL = pcre2-$(PCRE2_VERSION).tar.gz
|
2022-06-06 11:22:47 +05:30
|
|
|
PCRE2_BUILDIR = src
|
2022-06-06 10:16:20 +05:30
|
|
|
PCRE2_DESTDIR = dist
|
|
|
|
PCRE2_DESTDIR_ABS = $(shell realpath $(PCRE2_DESTDIR))
|
2022-06-06 13:21:31 +05:30
|
|
|
PCRE2_ARCHIVE = pcre2-dist.tar.gz
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 13:27:37 +05:30
|
|
|
all: build $(PCRE2_DESTDIR) $(PCRE2_ARCHIVE)
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-07 08:36:13 +05:30
|
|
|
$(PCRE2_TARBALL):
|
|
|
|
curl -fsSL -o "$(PCRE2_TARBALL)" "$(PCRE2_SOURCES)"
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-07 08:36:13 +05:30
|
|
|
$(PCRE2_BUILDIR): $(PCRE2_TARBALL)
|
|
|
|
@if ! [ -d "$(PCRE2_BUILDIR)" ]; then mkdir -v "$(PCRE2_BUILDIR)"; fi
|
2022-06-06 11:22:47 +05:30
|
|
|
tar -C $(PCRE2_BUILDIR) --strip-components=1 -xf "$(PCRE2_TARBALL)"
|
2022-06-07 08:36:13 +05:30
|
|
|
|
|
|
|
build: $(PCRE2_BUILDIR)
|
2022-06-06 11:22:47 +05:30
|
|
|
if [ -f "$(PCRE2_BUILDIR)/CmakeCache.txt" ]; then rm -v "$(PCRE2_BUILDIR)/CmakeCache.txt"; fi
|
|
|
|
cd "$(PCRE2_BUILDIR)" && cmake -DPCRE2_STATIC_PIC=ON -DPCRE2_SUPPORT_JIT=ON -DCMAKE_INSTALL_PREFIX="$(PCRE2_DESTDIR_ABS)" . && make
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 13:21:31 +05:30
|
|
|
$(PCRE2_DESTDIR): build
|
2022-06-06 10:16:20 +05:30
|
|
|
if ! [ -d "$(PCRE2_DESTDIR)" ]; then mkdir -v "$(PCRE2_DESTDIR)"; fi
|
2022-06-06 11:22:47 +05:30
|
|
|
cd "$(PCRE2_BUILDIR)" && make install
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 13:21:31 +05:30
|
|
|
$(PCRE2_ARCHIVE): $(PCRE2_DESTDIR)
|
|
|
|
tar -C "$(PCRE2_DESTDIR)" -cjf "$(PCRE2_ARCHIVE)" $$(ls -1 $(PCRE2_DESTDIR))
|
|
|
|
|
2022-06-06 10:16:20 +05:30
|
|
|
clean:
|
2022-06-07 08:36:13 +05:30
|
|
|
rm -fv "$(PCRE2_TARBALL)"
|
2022-06-06 11:22:47 +05:30
|
|
|
rm -rf "$(PCRE2_BUILDIR)"
|
|
|
|
rm -rf "$(PCRE2_DESTDIR)"
|
2022-06-06 13:21:31 +05:30
|
|
|
rm -fv "$(PCRE2_ARCHIVE)"
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 13:21:31 +05:30
|
|
|
.PHONY: clean build
|