This repository was archived by the owner on May 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.7 KB
/
Makefile
File metadata and controls
58 lines (46 loc) · 1.7 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
EXTENSION = numhstore
EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
DATA = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
MODULE_big = pg_numhstore
OBJS = src/hstore_array.o src/array_count.o src/avltree.o src/hstore_add.o src/array_add.o src/pg_numhstore.o
TESTS = setup $(filter-out test/sql/setup.sql test/sql/update.sql, $(wildcard test/sql/*.sql)) \
update $(filter-out test/sql/setup.sql test/sql/update.sql, $(wildcard test/sql/*.sql))
REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
REGRESS_OPTS = --inputdir=test --load-language=plpgsql
PG_CONFIG = pg_config
all:
release:
echo > sql/$(EXTENSION)--$(EXTVERSION).sql
#cat $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
cat \
sql/numhstore.sql \
sql/types.sql \
sql/hstore_from_array.sql \
sql/add.sql \
sql/div.sql \
sql/mul.sql \
sql/sub.sql \
sql/helper.sql \
sql/aggregates.sql \
sql/operators.sql \
sql/depricated.sql \
>> sql/$(EXTENSION)--$(EXTVERSION).sql
FUNCTIONS = \
sql/hstore_from_array.sql \
sql/add.sql \
sql/div.sql \
sql/mul.sql \
sql/sub.sql \
sql/helper.sql \
sql/depricated.sql
new_version:
echo > sql/$(EXTENSION)--$(EXTVERSION)--$(NEWVERSION).sql
sed 's/CREATE EXTENSION/UPDATE EXTENSION/g' sql/numhstore.sql >> sql/$(EXTENSION)--$(EXTVERSION)--$(NEWVERSION).sql
for i in $(FUNCTIONS); \
do sed 's/CREATE FUNCTION/CREATE OR REPLACE FUNCTION/g' $$i >> sql/$(EXTENSION)--$(EXTVERSION)--$(NEWVERSION).sql;\
done
sed -i '' 's/$(EXTVERSION)/$(NEWVERSION)/g' numhstore.control
DATA = $(wildcard sql/*--*.sql)
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)