aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjnthn <jnthn@jnthn.net>2014-03-16 19:45:18 +0100
committerjnthn <jnthn@jnthn.net>2014-03-16 21:50:18 +0100
commit45ea83817352fa1ef9caa86aa1b4157e6c765905 (patch)
tree1490877e3062fa19a6323537b68d2132d4f589a2
parent16df5398e60973992eb76fac04246bd942f5e137 (diff)
Work towards multi-backend build/install.
This gets closer to handling the Rakudo build/install itself on other backends, though not the module install.
-rw-r--r--Configure.pl10
-rw-r--r--tools/build/Makefile.in44
2 files changed, 43 insertions, 11 deletions
diff --git a/Configure.pl b/Configure.pl
index fe665c8..02972e9 100644
--- a/Configure.pl
+++ b/Configure.pl
@@ -98,13 +98,22 @@ MAIN: {
unless (%backends) {
if (defined $options{'gen-moar'}) {
$backends{moar} = 1;
+ $default_backend = 'moar';
}
else {
$backends{parrot} = 1;
+ $default_backend = 'parrot';
}
}
}
+ $config{backend_exes} = join ' ', map
+ { '$(PERL6_' . uc(substr $_, 0, 1) . '_EXE)' }
+ keys %backends;
+ $config{default_backend_exe} = '$(PERL6_' .
+ uc(substr $default_backend, 0, 1) .
+ '_EXE)';
+
unless ($backends{parrot}) {
warn "JVM/Moar-only builds are currently not supported, and might go wrong.\n";
}
@@ -123,6 +132,7 @@ MAIN: {
$config{'stagestats'} = '--stagestats' if $options{'makefile-timing'};
$config{'cpsep'} = $^O eq 'MSWin32' ? ';' : ':';
$config{'shell'} = $^O eq 'MSWin32' ? 'cmd' : 'sh';
+ $config{'bat'} = $^O eq 'MSWin32' ? '.bat' : '';
my $make = $config{'make'} = $^O eq 'MSWin32' ? 'nmake' : 'make';
my @prefixes = sort map substr($_, 0, 1), keys %backends;
diff --git a/tools/build/Makefile.in b/tools/build/Makefile.in
index e2f1d98..6e9acc6 100644
--- a/tools/build/Makefile.in
+++ b/tools/build/Makefile.in
@@ -1,45 +1,67 @@
# Copyright (C) 2006-2014, The Perl Foundation.
# $Id$
-PARROT_DIR = parrot
-NQP_DIR = nqp
-RAKUDO_DIR = rakudo
+PARROT_DIR = parrot
+MOAR_DIR = moarvm
+NQP_DIR = nqp
+RAKUDO_DIR = rakudo
STAR_VERSION = 2014.03
-# values from parrot_config
+# install location
PREFIX_DIR = @prefix@
+
+# values from parrot_config
PARROT_BIN_DIR = @bindir@
PARROT_VERSION = @versiondir@
PARROT_LIB_DIR = @libdir@$(PARROT_VERSION)
+# JVM install location
+JVM_BIN_DIR = $(PREFIX)/bin
+
+# MoarVM install location
+MOAR_BIN_DIR = $(PREFIX)/bin
+
EXE = @exe@
+BAT = @bat@
PERL = @perl@
CP = $(PERL) -MExtUtils::Command -e cp
RM_F = $(PERL) -MExtUtils::Command -e rm_f
MKPATH = $(PERL) -MExtUtils::Command -e mkpath
CHMOD = $(PERL) -MExtUtils::Command -e chmod
-PERL6_EXE = perl6-p$(EXE)
-PERL6_LANG_DIR = $(PARROT_LIB_DIR)/languages/perl6
-PERL6_INSTALL = $(PARROT_BIN_DIR)/$(PERL6_EXE)
+PERL6_P_EXE = perl6-p$(EXE)
+PERL6_P_LANG_DIR = $(PARROT_LIB_DIR)/languages/perl6
+PERL6_P_INSTALL = $(PARROT_BIN_DIR)/$(PERL6_P_EXE)
+
+PERL6_J_EXE = perl6-j$(BAT)
+PERL6_J_LANG_DIR = $(PREFIX)/languages/perl6
+PERL6_J_INSTALL = $(JVM_BIN_DIR)/$(PERL6_J_EXE)
+
+PERL6_M_EXE = perl6-m$(BAT)
+PERL6_M_LANG_DIR = $(PREFIX)/languages/perl6
+PERL6_M_INSTALL = $(MOAR_BIN_DIR)/$(PERL6_M_EXE)
MODULES = modules/MODULES.txt
all: rakudo
-rakudo: $(RAKUDO_DIR)/$(PERL6_EXE)
-$(RAKUDO_DIR)/$(PERL6_EXE):
+rakudo: @backend_exes@
+
+@backend_exes@:
@echo "== Configuring and building Rakudo"
cd $(RAKUDO_DIR) && $(PERL) Configure.pl --prefix=$(PREFIX_DIR) && $(MAKE)
+
rakudo-test: rakudo
cd $(RAKUDO_DIR) && $(MAKE) test
+
rakudo-spectest: rakudo
cd $(RAKUDO_DIR) && $(MAKE) spectest
+
rakudo-install: rakudo
cd $(RAKUDO_DIR) && $(MAKE) install
+ $(CP) $(DESTDIR)$(PERL6_INSTALL) @default_backend_exe@
+ $(CHMOD) 755 @default_backend_exe@
@win32_libparrot_copy@
- $(CP) $(DESTDIR)$(PERL6_INSTALL) $(PERL6_EXE)
- $(CHMOD) 755 $(PERL6_EXE)
modules-install: rakudo-install
@echo "== Installing modules"