This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (59 loc) · 1.58 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
64
65
66
67
68
69
70
V8DIR = ../v8
# set your custom C++ compler
CUSTOM_CC = g++
SRCS = plv8.cc plv8_type.cc plv8_func.cc
OBJS = $(SRCS:.cc=.o)
MODULE_big = plv8
EXTENSION = plv8
DATA = plv8.control plv8--1.0.sql
DATA_built = plv8.sql
REGRESS = init-extension plv8 inline json
override SHLIB_LINK += -lv8
CCFLAGS := $(filter-out -Wmissing-prototypes, $(CFLAGS))
CCFLAGS := $(filter-out -Wdeclaration-after-statement, $(CCFLAGS))
%.o : %.cc
g++ $(CCFLAGS) $(CPPFLAGS) -I $(V8DIR)/include -fPIC -c -o $@ $<
ifndef USE_PGXS
top_builddir = ../..
makefile_global = $(top_builddir)/src/Makefile.global
ifeq "$(wildcard $(makefile_global))" ""
USE_PGXS = 1 # use pgxs if not in contrib directory
endif
endif
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/$(MODULE_big)
include $(makefile_global)
include $(top_srcdir)/contrib/contrib-global.mk
endif
ifndef MAJORVERSION
MAJORVERSION := $(basename $(VERSION))
endif
# TODO: better idea for "$(MAJORVERSION) >= 9.1" ?
ifeq (,$(findstring $(MAJORVERSION),9.1 9.2))
DATA = uninstall_plv8.sql
REGRESS := init $(filter-out init-extension, $(REGRESS))
plv8.sql.in: plv8.sql.c
$(CC) -E -P $(CPPFLAGS) $< > $@
subclean:
rm -f plv8.sql.in
else
plv8.sql:
DATA_built =
install: plv8--1.0.sql
plv8--1.0.sql: plv8.sql.c
$(CC) -E -P $(CPPFLAGS) $< > $@
subclean:
rm -f plv8--1.0.sql
endif
ifneq ($(basename $(MAJORVERSION)), 9)
REGRESS := $(filter-out inline, $(REGRESS))
endif
# remove dependency to libxml2 and libxslt
LIBS := $(filter-out -lxml2, $(LIBS))
LIBS := $(filter-out -lxslt, $(LIBS))
.PHONY: subclean
clean: subclean