-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
executable file
·38 lines (27 loc) · 885 Bytes
/
Makefile
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
31
32
33
34
35
36
37
38
EXTENSION = bigtable
EXTVERSION = 0.1.0
DATA = sql/$(EXTENSION)--$(EXTVERSION).sql
PG_CONFIG = pg_config
all: sql/$(EXTENSION)--$(EXTVERSION).sql
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
cp $< $@
EXTRA_CLEAN = sql/$(EXTENSION)--$(EXTVERSION).sql
# Note that `MODULES = bigtable` implies a dependency on `bigtable.so`.
MODULES = bigtable
PGXX := $(shell utils/get_version.sh)
RS := $(shell which cargo >/dev/null && echo yes || echo no)
ifeq ($(shell uname -s),Darwin)
LINK_FLAGS = -C link-args='-Wl,-undefined,dynamic_lookup'
endif
.PHONY: bigtable.so
bigtable.so:
cargo rustc --release -- $(LINK_FLAGS)
cp target/release/libbigtable.* $@
.PHONY: cargoclean
cargoclean:
find . -name Cargo.lock -exec rm {} \;
cargo clean
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
clean: cargoclean
all: bigtable.so