-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (55 loc) · 2.18 KB
/
Makefile
File metadata and controls
70 lines (55 loc) · 2.18 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
59
60
61
62
63
64
65
66
67
68
69
70
NAME = plparrot
MODULE_big = plparrot
OBJS= plparrot.o
DATA_built = plparrot.sql
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plpgsql
TESTS = t/sql/test.sql
PLPERL6_TESTS = t/sql/plperl6.sql
REGRESS = $(patsubst t/sql/%.sql,%,$(TESTS))
EXTRA_CLEAN =
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
O = $(shell parrot_config o)
PARROTINCLUDEDIR = $(shell parrot_config includedir)
PARROTVERSIONDIR = $(shell parrot_config versiondir)
PARROTLIBDIR = $(shell parrot_config libdir)
PARROTINC = $(PARROTINCLUDEDIR)$(PARROTVERSIONDIR)
PARROTCONFIG = $(PARROTLIBDIR)/$(PARROTVERSIONDIR)/parrot_config
PARROTLANGDIR = $(PARROTLIBDIR)$(PARROTVERSIONDIR)/languages
PERL6PBC = $(PARROTLANGDIR)/perl6/perl6.pbc
PARROTLDFLAGS = $(shell parrot_config ldflags)
PARROTLINKFLAGS = $(shell parrot_config inst_libparrot_linkflags) $(PARROTCONFIG)$O
PARROTSHA1 = $(shell parrot_config sha1)
PARROT_VERSION = $(shell parrot_config VERSION)
# We may need to do various things with various versions of PostgreSQL.
# VERSION = $(shell $(PG_CONFIG) --version | awk '{print $$2}')
# PGVER_MAJOR = $(shell echo $(VERSION) | awk -F. '{ print ($$1 + 0) }')
# PGVER_MINOR = $(shell echo $(VERSION) | awk -F. '{ print ($$2 + 0) }')
# PGVER_PATCH = $(shell echo $(VERSION) | awk -F. '{ print ($$3 + 0) }')
override CPPFLAGS := -I$(PARROTINC) -I$(srcdir) $(CPPFLAGS)
override CFLAGS := $(PARROTLDFLAGS) $(PARROTLINKFLAGS) $(CFLAGS)
ifneq ( $(strip $(wildcard $PERL6PBC)),)
override CFLAGS := $(CFLAGS) -DHAS_PERL6 -D'PERL6PBC="$(PERL6PBC)"'
endif
# It would be nice if this ran before we compiled
all: check_version headers
@echo
@echo
@echo "Happy Hacking with PL/Parrot!"
@echo
@echo
headers:
./bin/text2macro.pl plparrot_secure.pir > plparrot.h
./bin/text2macro.pl plperl6.pir > plperl6.h
check_version:
@echo
@echo "Found Parrot Virtual Machine $(PARROT_VERSION) $(PARROTSHA1)"
@echo
test: all
psql -AX -f $(TESTS)
test_plperl6: all
psql -AX -f $(PLPERL6_TESTS)
release:
[ -d plparrot-$(VERSION) ] || ln -s . plparrot-$(VERSION)
git ls-files | grep -v .gitignore | perl -lane 'print "plparrot-$(VERSION)/$$F[0]"' | tar -zcv -T - -f plparrot-$(VERSION).tar.gz