-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 1.04 KB
/
Makefile
File metadata and controls
30 lines (23 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
EXTENSION = graph
CRATE_DIR = graph
PG_CONFIG ?= pg_config
PGRX ?= cargo pgrx
# Derive the PostgreSQL major from the selected pg_config so the build feature
# matches the target server. pgrx requires the active pgNN feature to match the
# pg_config major, otherwise the default (pg17) is built and install fails on
# any other major.
PG_MAJOR := $(shell $(PG_CONFIG) --version 2>/dev/null | sed -E 's/[^0-9]*([0-9]+).*/\1/')
PG_FEATURE := pg$(PG_MAJOR)
.PHONY: all install installcheck test clean
# pgrx extensions compile and install in a single step via `cargo pgrx install`.
# `make all` is provided for PGXN compatibility but delegates to the same
# install target, because `cargo pgrx package` requires a fully initialised
# pgrx environment that pgxn-client temp directories do not have.
all: install
install:
cd $(CRATE_DIR) && $(PGRX) install --pg-config $(PG_CONFIG) --release --no-default-features --features $(PG_FEATURE)
installcheck:
cd $(CRATE_DIR) && $(PGRX) test $(PG_FEATURE)
test: installcheck
clean:
cd $(CRATE_DIR) && cargo clean