Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Work towards multi-backend build/install.
This gets closer to handling the Rakudo build/install itself
on other backends, though not the module install.
  • Loading branch information
jnthn committed Mar 16, 2014
1 parent 16df539 commit 45ea838
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 11 deletions.
10 changes: 10 additions & 0 deletions Configure.pl
Expand Up @@ -98,13 +98,22 @@
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";
}
Expand All @@ -123,6 +132,7 @@
$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;
Expand Down
44 changes: 33 additions & 11 deletions 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"
Expand Down

0 comments on commit 45ea838

Please sign in to comment.