-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
64 lines (43 loc) · 1.39 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
EXTENSION = vasco
EXTVERSION = 0.2.0
PG_CONFIG ?= pg_config
# Do not hardcode them here, but pick them up from the .control file
EXT_CTRL_FILE = $(EXTENSION).control
PGFILEDESC = $(shell cat $(EXT_CTRL_FILE) | grep 'comment' | sed "s/^.*'\(.*\)'$\/\1/g")
EXT_REQUIRES = $(shell cat $(EXT_CTRL_FILE) | grep 'requires' | sed "s/^.*'\(.*\)'$\/\1/g")
PGVERSION = $(shell $(PG_CONFIG) --version | sed "s/PostgreSQL //g")
LICENSE = LICENSE
MODULE_big = $(EXTENSION)
OBJS = \
src/mine.o \
src/vasco.o
EXT_SQL_FILE = sql/$(EXTENSION)--$(EXTVERSION).sql
# Order of .sql files matters!
SQL_FILES = sql/preamble.sql \
sql/schemas.sql \
sql/vasco.sql \
sql/explore.sql
ifdef WITH_PGVECTOR
SQL_FILES += sql/vasco_pgvector.sql
endif
TESTS = $(wildcard test/sql/*.sql)
REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
REGRESS_OPTS = --inputdir=test --load-extension=$(EXTENSION)
$(EXT_SQL_FILE): $(SQL_FILES)
@cat $^ > $@
all: $(EXT_SQL_FILE)
DATA = $(wildcard sql/*--*.sql) #$(EXT_SQL_FILE)
EXTRA_CLEAN += dist $(EXT_SQL_FILE) *.png
.PHONY: dist
dist:
mkdir -p dist
git archive --format zip --prefix=$(EXTENSION)-$(EXTVERSION)/ --output dist/$(EXTENSION)-$(EXTVERSION).zip main
ifdef DEBUG
COPT += -O0 -Werror -g
ASSEMBLY_FILE = $(MODULE_big).s
$(ASSEMBLY_FILE): $(MODULE_big)
objdump -d $(MODULE_big).o > $@
EXTRA_CLEAN += $(ASSEMBLY_FILE)
endif
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)