-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
39 lines (30 loc) · 1.07 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
EXTENSION = set_user
EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
LDFLAGS_SL += $(filter -lm, $(LIBS))
MODULES = src/set_user
PG_CONFIG = pg_config
PGFILEDESC = "set_user - similar to SET ROLE but with added logging"
REGRESS = set_user
all: extension/$(EXTENSION)--$(EXTVERSION).sql
extension/$(EXTENSION)--$(EXTVERSION).sql: extension/set_user.sql
cat $^ > $@
DATA = $(wildcard updates/*--*.sql) extension/$(EXTENSION)--$(EXTVERSION).sql
EXTRA_CLEAN = extension/$(EXTENSION)--$(EXTVERSION).sql
ifdef NO_PGXS
subdir = contrib/set_user
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
else
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
endif
.PHONY: install-headers uninstall-headers
install: install-headers
install-headers:
$(MKDIR_P) "$(DESTDIR)$(includedir)"
$(INSTALL_DATA) "src/set_user.h" "$(DESTDIR)$(includedir)"
uninstall: uninstall-headers
uninstall-headers:
rm "$(DESTDIR)$(includedir)/set_user.h"