-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
36 lines (24 loc) · 865 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
EXTENSION = plmustache
EXTVERSION = 0.1
DATA = $(wildcard sql/*--*.sql)
MODULE_big = $(EXTENSION)
OBJS = src/plmustache.o src/observation.o src/build.o
TESTS = $(wildcard test/sql/*.sql)
REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
REGRESS_OPTS = --inputdir=test
PG_CONFIG = pg_config
SHLIB_LINK = -lmustach
PG_CFLAGS = -std=c99 -Wno-declaration-after-statement -Wall -Werror -Wshadow
PGXS := $(shell $(PG_CONFIG) --pgxs)
all: sql/$(EXTENSION)--$(EXTVERSION).sql $(EXTENSION).control
.PHONY: clean_generated
clean_generated:
rm -f $(EXTENSION).control
rm -f sql/$(EXTENSION)--$(EXTVERSION).sql
# extra dep for clean target in pgxs.mk
clean: clean_generated
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
cp $< $@
$(EXTENSION).control:
sed "s/@EXTVERSION@/$(EXTVERSION)/g" $(EXTENSION).control.in > $(EXTENSION).control
include $(PGXS)