Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 77327a4a95
Fetching contributors…

Cannot retrieve contributors at this time

file 83 lines (70 sloc) 2.926 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 71 72 73 74 75 76 77 78 79 80 81 82 83
# Makefile for STD.pm6 viv etcetera in pugs/src/perl6
.PHONY: six five all sixfast clean snap snaptest

INVARIANT=Actions.pm CORE.setting CursorBase.pmc DEBUG.pmc LazyMap.pm NAME.pmc\
RE_ast.pmc Stash.pmc mangle.pl uniprops viv
GENERATE=STD.pmc Cursor.pmc
BOOTFILES=boot/STD.pmc boot/Cursor.pmc

STD_SOURCE=STD.pm6 Cursor.pm6 CursorBase.pm6 lib/Stash.pm6 lib/NAME.pm6\
           lib/DEBUG.pm6
CURSOR_SOURCE=Cursor.pm6 CursorBase.pm6

PERL=perl

RM_RF=$(PERL) -MExtUtils::Command -e rm_rf
CP=$(PERL) -MExtUtils::Command -e cp
MV=$(PERL) -MExtUtils::Command -e mv
MKDIR=mkdir
GIT=git
# no snaptest on win32 just yet
CP_R=cp -r

all: syml/CORE.syml STD_P5.pmc syml/CORE5.syml
six: syml/CORE.syml
five: syml/CORE5.syml

clean:
$(RM_RF) syml STD_P5.pmc $(GENERATE) boot/syml boot/.stamp .stamp\
STD_P5.pm5 STD.pm5 Cursor.pm5 snap.old snap.new

########################################
# */syml/CORE.syml indicates that the corresponding compiler is "usable"
boot/syml/CORE.syml: $(INVARIANT) $(BOOTFILES)
$(RM_RF) boot/syml
$(PERL) ./viv --boot --noperl6lib --compile-setting CORE.setting

STD.pmc: $(STD_SOURCE) boot/syml/CORE.syml $(INVARIANT)
$(PERL) ./viv --boot --noperl6lib -5 -o STD.pm5 STD.pm6
$(PERL) tools/compact_pmc < STD.pm5 > STD.pmc
STD_P5.pmc: STD_P5.pm6 boot/syml/CORE.syml $(INVARIANT)
$(PERL) ./viv --boot --noperl6lib -5 -o STD_P5.pm5 STD_P5.pm6
$(PERL) tools/compact_pmc < STD_P5.pm5 > STD_P5.pmc
Cursor.pmc: $(CURSOR_SOURCE) boot/syml/CORE.syml $(INVARIANT)
$(PERL) ./viv --boot --noperl6lib -5 -o Cursor.pm5 Cursor.pm6
$(PERL) tools/compact_pmc < Cursor.pm5 > Cursor.pmc
syml/CORE.syml: STD.pmc Cursor.pmc $(INVARIANT)
$(RM_RF) syml
$(PERL) ./viv --noperl6lib --compile-setting CORE.setting
$(CP) boot/syml/CursorBase.syml boot/syml/Cursor.syml boot/syml/DEBUG.syml boot/syml/NAME.syml boot/syml/Stash.syml boot/syml/STD.syml syml

syml/CORE5.syml: STD.pmc CORE5.setting Cursor.pmc $(INVARIANT)
$(PERL) ./viv --noperl6lib --compile-setting CORE5.setting

# reboot after incompatibly changing syml format
reboot: six
$(CP) $(GENERATE) boot
$(RM_RF) boot/syml

snap: all
$(RM_RF) snap.new
$(MKDIR) snap.new
$(GIT) log -1 --pretty="format:%h" > snap.new/revision
$(CP_R) $(INVARIANT) $(GENERATE) syml STD_P5.pmc lib tools/tryfile tools/teststd snap.new
-$(RM_RF) snap.old
-$(MV) snap snap.old
$(MV) snap.new snap

snaptest: snap
cd snap && $(PERL) teststd $(realpath ../roast)

#List all targets with brief descriptions.
# Gradual shaving of targets with Occam's Razor would be a Good Thing.
help:
@echo
@echo 'In pugs/src/perl6 you can make these targets:'
@echo
@echo 'six (default) builds viv for Perl6'
@echo 'all builds viv for Perl5 too'
@echo 'reboot builds and updates boot; test first!'
@echo 'clean removes generated files'
@echo 'help show this list'
@echo 'snaptest run snapshot teststd on pugs/t/*'
@echo
Something went wrong with that request. Please try again.