-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
executable file
·97 lines (77 loc) · 4.17 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
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
#-------------------------------------------------------------------------
# Copyright (c) 2004, 2005, 2006 TADA AB - Taby Sweden
# Distributed under the terms shown in the file COPYRIGHT
# found in the root folder of this project or at
# http://eng.tada.se/osprojects/COPYRIGHT.html
#
# @author Thomas Hallgren
#
# Top level Makefile for PLJava
#
# To compile a PLJava for PostgreSQL 8.x the makefile system will utilize
# the PostgreSQL pgxs system. The only prerequisite for such a compile is
# that a PostgreSQL 8.x is installed on the system and that the PATH is set
# so that the binaries of this installed can be executed.
#
#-------------------------------------------------------------------------
MODULE_big = pljava
include release.mk
PROJDIR = $(shell bash -c pwd)
PGXS = $(shell pg_config --pgxs)
# GPDB Makefile.global messes up JAVA_HOME
PLJAVA_HOME := $(JAVA_HOME)
include $(PGXS)
JAVA_HOME := $(PLJAVA_HOME)
PLJAVADATA = $(DESTDIR)$(datadir)/pljava
PLJAVALIB = $(DESTDIR)$(pkglibdir)/java
PLJAVAEXT = $(DESTDIR)$(datadir)/extension
REGRESS_OPTS = --dbname=pljava_test --create-role=pljava_test
REGRESS = pljava_ext_init pljava_functions pljava_test pljava_ext_cleanup pljava_init pljava_functions pljava_test pljava_uninstall
REGRESS_DIR = $(top_builddir)
.DEFAULT_GOAL := build
.PHONY: build installdirs install uninstall test localconfig targetconfig installcheck targetcheck release
install-nar-snapshot:
curl -o nar-maven-plugin.tar.gz https://codeload.github.com/maven-nar/nar-maven-plugin/tar.gz/refs/tags/nar-maven-plugin-3.5.2
tar xzf nar-maven-plugin.tar.gz
mv nar-maven-plugin-nar-maven-plugin-3.5.2 nar-maven-plugin
(cd nar-maven-plugin ; mvn)
build: install-nar-snapshot
mvn clean install
find $(PROJDIR)/pljava-so/target/nar/ -name "libpljava-so-$(PLJAVA_OSS_VERSION).so" -exec cp {} $(PROJDIR)/$(MODULE_big).so \;
cp $(PROJDIR)/pljava/target/pljava-$(PLJAVA_OSS_VERSION).jar $(PROJDIR)/target/pljava.jar
cp $(PROJDIR)/pljava-examples/target/pljava-examples-$(PLJAVA_OSS_VERSION).jar $(PROJDIR)/target/examples.jar
installdirs:
$(MKDIR_P) '$(PLJAVALIB)'
$(MKDIR_P) '$(PLJAVADATA)'
$(MKDIR_P) '$(PLJAVADATA)/docs'
$(MKDIR_P) '$(PLJAVAEXT)'
install: installdirs install-lib
$(INSTALL_DATA) '$(PROJDIR)/pljava/target/pljava-$(PLJAVA_OSS_VERSION).jar' '$(PLJAVALIB)/pljava.jar'
$(INSTALL_DATA) '$(PROJDIR)/pljava-examples/target/pljava-examples-$(PLJAVA_OSS_VERSION).jar' '$(PLJAVALIB)/examples.jar'
$(INSTALL_DATA) '$(PROJDIR)/gpdb/installation/install.sql' '$(PLJAVADATA)'
$(INSTALL_DATA) '$(PROJDIR)/gpdb/installation/uninstall.sql' '$(PLJAVADATA)'
$(INSTALL_DATA) '$(PROJDIR)/gpdb/installation/install_pljavat.sql' '$(PLJAVADATA)'
$(INSTALL_DATA) '$(PROJDIR)/gpdb/installation/uninstall_pljavat.sql' '$(PLJAVADATA)'
$(INSTALL_DATA) '$(PROJDIR)/gpdb/installation/examples.sql' '$(PLJAVADATA)'
$(INSTALL_DATA) '$(PROJDIR)/gpdb/installation/pljava--1.5.0.sql' '$(PLJAVAEXT)'
$(INSTALL_DATA) '$(PROJDIR)/gpdb/installation/pljava.control' '$(PLJAVAEXT)'
$(INSTALL_DATA) '$(PROJDIR)/gpdb/installation/pljavat--1.5.0.sql' '$(PLJAVAEXT)'
$(INSTALL_DATA) '$(PROJDIR)/gpdb/installation/pljavat.control' '$(PLJAVAEXT)'
find $(PROJDIR)/docs -name "*.html" -exec $(INSTALL_DATA) {} '$(PLJAVADATA)/docs' \;
uninstall: uninstall-lib
rm -rf '$(PLJAVALIB)'
rm -rf '$(PLJAVADATA)'
test:
sed -i '/.* # PLJAVA.*/d' $(MASTER_DATA_DIRECTORY)/pg_hba.conf
echo 'host all pljava_test 0.0.0.0/0 trust # PLJAVA' >> $(MASTER_DATA_DIRECTORY)/pg_hba.conf
echo 'local all pljava_test trust # PLJAVA' >> $(MASTER_DATA_DIRECTORY)/pg_hba.conf
gpstop -u
cd $(PROJDIR)/gpdb/tests && $(REGRESS_DIR)/src/test/regress/pg_regress --bindir=$(bindir) $(REGRESS_OPTS) $(REGRESS)
localconfig:
gpconfig -c pljava_classpath -v $(PROJDIR)/target/
targetconfig:
gpconfig -c pljava_classpath -v '.'
installcheck: localconfig test
targetcheck: targetconfig test
release:
$(MAKE) -C gpdb/packaging mkrelease