[svn:parrot] r7 - in punie/trunk: . config/makefiles
fperrad at svn.parrot.org
fperrad at svn.parrot.org
Mon Mar 9 16:16:17 UTC 2009
Author: fperrad
Date: Mon Mar 9 16:16:17 2009
New Revision: 7
URL: https://trac.parrot.org/parrot/changeset/7
Log:
[punie] re-run mk_language_shell.pl
work with an installed parrot
Added:
punie/trunk/Configure.pl
Deleted:
punie/trunk/Makefile
Modified:
punie/trunk/ (props changed)
punie/trunk/config/makefiles/root.in
punie/trunk/punie.pir
Added: punie/trunk/Configure.pl
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ punie/trunk/Configure.pl Mon Mar 9 16:16:17 2009 (r7)
@@ -0,0 +1,65 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use 5.008;
+
+# Get a list of parrot-configs to invoke.
+my @parrot_config_exe = (
+ 'parrot/parrot_config',
+ '../../parrot_config',
+ 'parrot_config',
+);
+
+# Get configuration information from parrot_config
+my %config = read_parrot_config(@parrot_config_exe);
+unless (%config) {
+ die "Unable to locate parrot_config.";
+}
+
+# Create the Makefile using the information we just got
+create_makefiles(%config);
+
+sub read_parrot_config {
+ my @parrot_config_exe = @_;
+ my %config = ();
+ for my $exe (@parrot_config_exe) {
+ no warnings;
+ if (open my $PARROT_CONFIG, '-|', "$exe --dump") {
+ print "Reading configuration information from $exe\n";
+ while (<$PARROT_CONFIG>) {
+ $config{$1} = $2 if (/(\w+) => '(.*)'/);
+ }
+ close $PARROT_CONFIG;
+ last if %config;
+ }
+ }
+ %config;
+}
+
+
+# Generate Makefiles from a configuration
+sub create_makefiles {
+ my %config = @_;
+ my %makefiles = (
+ 'config/makefiles/root.in' => 'Makefile',
+# 'config/makefiles/pmc.in' => 'src/pmc/Makefile',
+# 'config/makefiles/ops.in' => 'src/ops/Makefile',
+ );
+ my $build_tool = $config{libdir} . $config{versiondir}
+ . '/tools/dev/gen_makefile.pl';
+
+ foreach my $template (keys %makefiles) {
+ my $makefile = $makefiles{$template};
+ print "Creating $makefile\n";
+ system($config{perl}, $build_tool, $template, $makefile);
+ }
+}
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Deleted: punie/trunk/Makefile
==============================================================================
--- punie/trunk/Makefile Mon Mar 9 16:16:17 2009 (r6)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,82 +0,0 @@
-# ex: set ro:
-# DO NOT EDIT THIS FILE
-# Generated by Parrot::Configure::Compiler from languages/punie/config/makefiles/root.in
-
-# Copyright (C) 2005-2009, Parrot Foundation.
-# $Id: root.in 36833 2009-02-17 20:09:26Z allison $
-
-# Setup some commands
-LN_S = /bin/ln -s
-PERL = /usr/bin/perl
-RM_F = $(PERL) -MExtUtils::Command -e rm_f
-PARROT = ../../parrot
-BUILD_DIR = /home/allison/projects/svn/parrot
-RECONFIGURE = $(PERL) /home/allison/projects/svn/parrot/tools/dev/reconfigure.pl
-PGE_DIR = ../../compilers/pge
-NQP_DIR = ../../compilers/nqp
-CP = $(PERL) -MExtUtils::Command -e cp
-
-PARROT_LIBRARY = ../../runtime/parrot/library
-PGE_LIBRARY = ../../runtime/parrot/library/PGE
-
-# the default target
-all: punie.pbc
-
-SOURCES = punie.pir \
- src/parser/grammar.pg \
- src/parser/actions.pm \
- src/builtins/builtins.pir \
-
-# the default target
-punie.pbc: $(PARROT) $(NQP_DIR)/nqp.pbc $(PGE_LIBRARY)/Perl6Grammar.pir $(SOURCES)
- $(PARROT) $(PGE_LIBRARY)/Perl6Grammar.pir --output=src/gen_punie.pir src/parser/grammar.pg
- $(PARROT) $(NQP_DIR)/nqp.pbc --target=pir --output=src/gen_punie-actions.pir src/parser/actions.pm
- $(PARROT) -o punie.pbc punie.pir
-
-# This is a listing of all targets, that are meant to be called by users
-help:
- @echo ""
- @echo "Following targets are available for the user:"
- @echo ""
- @echo " all: punie.pbc"
- @echo " This is the default."
- @echo "Testing:"
- @echo " test: Run the test suite."
- @echo " testclean: Clean up test results."
- @echo ""
- @echo "Cleaning:"
- @echo " clean: Basic cleaning up."
- @echo " realclean: Removes also files generated by 'Configure.pl'"
- @echo " distclean: Removes also anything built, in theory"
- @echo ""
- @echo "Misc:"
- @echo " help: Print this help message."
- @echo ""
-
-test: all
- $(PERL) -Ilib -I../../lib t/harness
-
-# regenerate the Makefile
-Makefile: config/makefiles/root.in
- cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::languages --languages=punie
-
-testclean:
- $(RM_F) "t/*.p1" "t/*.out" "t/*.pir"
-
-CLEANUPS = \
- punie.pbc \
- src/gen_punie.pir \
- src/gen_punie-actions.pir \
-
-clean: testclean
- $(RM_F) $(CLEANUPS)
-
-realclean: clean
- $(RM_F) Makefile
-
-distclean: realclean
-
-# Local variables:
-# mode: makefile
-# End:
-# vim: ft=make:
Modified: punie/trunk/config/makefiles/root.in
==============================================================================
--- punie/trunk/config/makefiles/root.in Fri Feb 27 00:30:32 2009 (r6)
+++ punie/trunk/config/makefiles/root.in Mon Mar 9 16:16:17 2009 (r7)
@@ -1,81 +1,170 @@
-# Copyright (C) 2005-2009, Parrot Foundation.
-# $Id: root.in 36833 2009-02-17 20:09:26Z allison $
-
-# Setup some commands
-LN_S = @lns@
-PERL = @perl@
-RM_F = @rm_f@
-PARROT = ../../parrot at exe@
-BUILD_DIR = @build_dir@
-RECONFIGURE = $(PERL) @build_dir@/tools/dev/reconfigure.pl
-PGE_DIR = ../../compilers/pge
-NQP_DIR = ../../compilers/nqp
-CP = @cp@
-#CONDITIONED_LINE(darwin):
-#CONDITIONED_LINE(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
-#CONDITIONED_LINE(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
-
-PARROT_LIBRARY = ../../runtime/parrot/library
-PGE_LIBRARY = ../../runtime/parrot/library/PGE
-
-# the default target
-all: punie.pbc
-
-SOURCES = punie.pir \
- src/parser/grammar.pg \
- src/parser/actions.pm \
- src/builtins/builtins.pir \
-
-# the default target
-punie.pbc: $(PARROT) $(NQP_DIR)/nqp.pbc $(PGE_LIBRARY)/Perl6Grammar.pir $(SOURCES)
- $(PARROT) $(PGE_LIBRARY)/Perl6Grammar.pir --output=src/gen_punie.pir src/parser/grammar.pg
- $(PARROT) $(NQP_DIR)/nqp.pbc --target=pir --output=src/gen_punie-actions.pir src/parser/actions.pm
- $(PARROT) -o punie.pbc punie.pir
-
-# This is a listing of all targets, that are meant to be called by users
-help:
- @echo ""
- @echo "Following targets are available for the user:"
- @echo ""
- @echo " all: punie.pbc"
- @echo " This is the default."
- @echo "Testing:"
- @echo " test: Run the test suite."
- @echo " testclean: Clean up test results."
- @echo ""
- @echo "Cleaning:"
- @echo " clean: Basic cleaning up."
- @echo " realclean: Removes also files generated by 'Configure.pl'"
- @echo " distclean: Removes also anything built, in theory"
- @echo ""
- @echo "Misc:"
- @echo " help: Print this help message."
- @echo ""
-
-test: all
- $(PERL) -Ilib -I../../lib t/harness
-
-# regenerate the Makefile
-Makefile: config/makefiles/root.in
- cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::languages --languages=punie
-
-testclean:
- $(RM_F) "t/*.p1" "t/*.out" "t/*.pir"
-
-CLEANUPS = \
- punie.pbc \
- src/gen_punie.pir \
- src/gen_punie-actions.pir \
-
-clean: testclean
- $(RM_F) $(CLEANUPS)
-
-realclean: clean
- $(RM_F) Makefile
-
-distclean: realclean
-
-# Local variables:
-# mode: makefile
-# End:
-# vim: ft=make:
+# Copyright (C) 2005-2009, Parrot Foundation.
+# $Id: root.in 36833 2009-02-17 20:09:26Z allison $
+
+## arguments we want to run parrot with
+PARROT_ARGS :=
+
+## configuration settings
+VERSION := @versiondir@
+BIN_DIR := @bin_dir@
+LIB_DIR := @lib_dir@$(VERSION)
+DOC_DIR := @doc_dir@$(VERSION)
+MANDIR := @mandir@$(VERSION)
+
+# Set up extensions
+LOAD_EXT := @load_ext@
+O := @o@
+
+# Various paths
+PERL6GRAMMAR := $(LIB_DIR)/library/PGE/Perl6Grammar.pbc
+NQP := $(LIB_DIR)/languages/nqp/nqp.pbc
+PCT := $(LIB_DIR)/library/PCT.pbc
+
+## Setup some commands
+MAKE := @make_c@
+PERL := @perl@
+CAT := @cat@
+CHMOD := @chmod@
+CP := @cp@
+MKPATH := @mkpath@
+RM_F := @rm_f@
+RM_RF := @rm_rf@
+POD2MAN := pod2man
+#IF(parrot_is_shared and not(cygwin or win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH)
+PARROT := $(BIN_DIR)/parrot at exe@
+PBC_TO_EXE := $(BIN_DIR)/pbc_to_exe at exe@
+#IF(darwin):
+#IF(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
+#IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
+
+SOURCES := \
+ src/gen_grammar.pir \
+ src/gen_actions.pir \
+ src/gen_builtins.pir \
+ punie.pir
+
+BUILTINS_PIR := \
+ src/builtins/builtins.pir
+
+DOCS := README
+
+BUILD_CLEANUPS := \
+ punie.pbc \
+ "src/gen_*.pir" \
+ "*.c" \
+ "*$(O)" \
+ punie at exe@ \
+#IF(win32): parrot-punie.exe \
+#IF(win32): parrot-punie.iss \
+#IF(win32): "setup-parrot-*.exe" \
+ installable_punie at exe@
+
+TEST_CLEANUPS := \
+ "t/*.p1" \
+ "t/*.out" \
+ "t/*.pir"
+
+build: punie.pbc
+
+all: build punie at exe@ installable
+
+punie.pbc: $(SOURCES)
+ $(PARROT) $(PARROT_ARGS) -o punie.pbc punie.pir
+
+punie at exe@: punie.pbc
+ $(PBC_TO_EXE) punie.pbc
+
+src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg
+ $(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
+ --output=src/gen_grammar.pir \
+ src/parser/grammar.pg
+
+src/gen_actions.pir: $(NQP) src/parser/actions.pm
+ $(PARROT) $(PARROT_ARGS) $(NQP) --output=src/gen_actions.pir \
+ --target=pir src/parser/actions.pm
+
+src/gen_builtins.pir: $(BUILTINS_PIR)
+ $(CAT) $(BUILTINS_PIR) > src/gen_builtins.pir
+
+installable: installable_punie at exe@
+
+installable_punie at exe@: punie.pbc
+ $(PBC_TO_EXE) punie.pbc --install
+
+Makefile: config/makefiles/root.in
+ $(PERL) Configure.pl
+
+# This is a listing of all targets, that are meant to be called by users
+help:
+ @echo ""
+ @echo "Following targets are available for the user:"
+ @echo ""
+ @echo " build: punie.pbc"
+ @echo " This is the default."
+ @echo " punie at exe@ Self-hosting binary not to be installed."
+ @echo " all: punie.pbc punie at exe@ installable"
+ @echo " installable: Create libs and self-hosting binaries to be installed."
+ @echo " install: Install the installable targets and docs."
+ @echo ""
+ @echo "Testing:"
+ @echo " test: Run the test suite."
+ @echo " test-installable: Test self-hosting targets."
+ @echo " testclean: Clean up test results."
+ @echo ""
+ @echo "Cleaning:"
+ @echo " clean: Basic cleaning up."
+ @echo " realclean: Removes also files generated by 'Configure.pl'"
+ @echo " distclean: Removes also anything built, in theory"
+ @echo ""
+ @echo "Misc:"
+ @echo " help: Print this help message."
+ @echo ""
+
+test: build
+ $(PERL) -Ilib -I../../lib t/harness
+
+# basic run for missing libs
+test-installable: installable
+ echo "print 1;" | ./installable_punie at exe@
+
+install: installable
+ $(CP) installable_punie at exe@ $(BIN_DIR)/parrot-punie at exe@
+ $(CHMOD) 0755 $(BIN_DIR)/parrot-punie at exe@
+ -$(MKPATH) $(LIB_DIR)/languages/punie
+ $(CP) punie.pbc $(LIB_DIR)/languages/punie/punie.pbc
+ -$(MKPATH) $(MANDIR)/man1
+ $(POD2MAN) punie.pir > $(MANDIR)/man1/parrot-punie.1
+ -$(MKPATH) $(DOC_DIR)/languages/punie
+ $(CP) $(DOCS) $(DOC_DIR)/languages/punie
+
+uninstall:
+ $(RM_F) $(BIN_DIR)/parrot-punie at exe@
+ $(RM_RF) $(LIB_DIR)/languages/punie
+ $(RM_F) $(MANDIR)/man1/parrot-punie.1
+ $(RM_RF) $(DOC_DIR)/languages/punie
+
+win32-inno-installer: installable
+ -$(MKPATH) man/man1
+ $(POD2MAN) punie.pir > man/man1/parrot-punie.1
+ -$(MKPATH) man/html
+ pod2html --infile punie.pir --outfile man/html/parrot-punie.html
+ $(CP) installable_punie at exe@ parrot-punie.exe
+ $(PERL) $(LIB_DIR)/tools/dev/mk_inno_language.pl punie
+ iscc parrot-punie.iss
+
+testclean:
+ $(RM_F) $(TEST_CLEANUPS)
+
+clean:
+ $(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS)
+
+realclean:
+ $(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS) Makefile
+
+distclean: realclean
+
+# Local variables:
+# mode: makefile
+# End:
+# vim: ft=make:
+
Modified: punie/trunk/punie.pir
==============================================================================
--- punie/trunk/punie.pir Fri Feb 27 00:30:32 2009 (r6)
+++ punie/trunk/punie.pir Mon Mar 9 16:16:17 2009 (r7)
@@ -42,9 +42,9 @@
.tailcall $P0.'command_line'(args)
.end
-.include 'src/builtins/builtins.pir'
-.include 'src/gen_punie.pir'
-.include 'src/gen_punie-actions.pir'
+.include 'src/gen_builtins.pir'
+.include 'src/gen_grammar.pir'
+.include 'src/gen_actions.pir'
=head1 LICENSE
More information about the parrot-commits
mailing list