-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (83 loc) · 2.88 KB
/
Makefile
File metadata and controls
100 lines (83 loc) · 2.88 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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# pgedge_vectorizer PostgreSQL Extension Makefile
# Supports PostgreSQL 14-17
EXTENSION = pgedge_vectorizer
EXTVERSION = 1.1
# Extension module and data files
MODULE_big = $(EXTENSION)
OBJS = src/pgedge_vectorizer.o \
src/guc.o \
src/bm25.o \
src/chunking.o \
src/hybrid_chunking.o \
src/tokenizer.o \
src/provider.o \
src/provider_openai.o \
src/provider_voyage.o \
src/provider_ollama.o \
src/worker.o \
src/queue.o \
src/embed.o
DATA = sql/$(EXTENSION)--$(EXTVERSION).sql \
sql/$(EXTENSION)--1.0.sql \
sql/$(EXTENSION)--1.0--1.1.sql \
sql/$(EXTENSION)--1.0-beta2.sql \
sql/$(EXTENSION)--1.0-beta3.sql \
sql/$(EXTENSION)--1.0-beta1--1.0-beta2.sql \
sql/$(EXTENSION)--1.0-beta2--1.0-beta3.sql \
sql/$(EXTENSION)--1.0-beta3--1.0.sql
# Test configuration for pg_regress
REGRESS = setup chunking hybrid_chunking queue vectorization multi_column maintenance edge_cases providers worker cleanup embedding pk_types stale_embeddings hybrid_test
REGRESS_OPTS = --inputdir=test --outputdir=test
# Documentation files (if any)
# DOCS = README.md
# Compiler and linker flags
PG_CPPFLAGS = -I$(srcdir)/src
SHLIB_LINK = -lcurl -lm
# For systems with libcurl in non-standard locations
# Uncomment and adjust if needed:
# PG_CPPFLAGS += -I/usr/local/include
# SHLIB_LINK += -L/usr/local/lib
# Check for required PostgreSQL version (14+)
# This will be evaluated at build time
PG_MIN_VERSION = 140000
# Use PGXS for building
PG_CONFIG ?= pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
# Check if pg_config is available
ifeq ($(PGXS),)
$(error pg_config not found. Please install PostgreSQL development packages or set PG_CONFIG)
endif
include $(PGXS)
# Version compatibility check
pg_version_num := $(shell $(PG_CONFIG) --version | sed 's/^PostgreSQL *//' | \
sed 's/\([0-9]*\)\.\([0-9]*\).*/\1\2/')
# Ensure we're building for PostgreSQL 14+
check-pg-version:
@echo "Building for PostgreSQL version: $(shell $(PG_CONFIG) --version)"
@if [ $(pg_version_num) -lt 14 ]; then \
echo "Error: PostgreSQL 14 or later is required"; \
exit 1; \
fi
# Make sure version check runs before build
all: check-pg-version
# Installation verification
installcheck: check-pg-version
# Custom targets
.PHONY: check-pg-version
# Help target
help:
@echo "pgedge_vectorizer - PostgreSQL Vectorization Extension"
@echo ""
@echo "Targets:"
@echo " all - Build the extension (requires PostgreSQL 14+)"
@echo " install - Install the extension"
@echo " installcheck - Run tests against installed extension"
@echo " clean - Remove build artifacts"
@echo ""
@echo "Requirements:"
@echo " - PostgreSQL 14 or later"
@echo " - pgvector extension installed"
@echo " - libcurl development files"
@echo ""
@echo "Configuration:"
@echo " PG_CONFIG - Path to pg_config (default: pg_config in PATH)"