[svn:parrot] r37314 - in trunk/languages/cardinal: . config/makefiles src/classes

fperrad at svn.parrot.org fperrad at svn.parrot.org
Wed Mar 11 18:31:03 UTC 2009


Author: fperrad
Date: Wed Mar 11 18:31:02 2009
New Revision: 37314
URL: https://trac.parrot.org/parrot/changeset/37314

Log:
[Cardinal] re-run mk_language_shell.pl

Added:
   trunk/languages/cardinal/Configure.pl   (contents, props changed)
Modified:
   trunk/languages/cardinal/config/makefiles/root.in
   trunk/languages/cardinal/src/classes/Object.pir

Added: trunk/languages/cardinal/Configure.pl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/languages/cardinal/Configure.pl	Wed Mar 11 18:31:02 2009	(r37314)
@@ -0,0 +1,65 @@
+# $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:
+

Modified: trunk/languages/cardinal/config/makefiles/root.in
==============================================================================
--- trunk/languages/cardinal/config/makefiles/root.in	Wed Mar 11 18:24:29 2009	(r37313)
+++ trunk/languages/cardinal/config/makefiles/root.in	Wed Mar 11 18:31:02 2009	(r37314)
@@ -2,49 +2,49 @@
 ## $Id$
 
 ## arguments we want to run parrot with
-PARROT_ARGS =
+PARROT_ARGS   :=
 
 ## configuration settings
-BUILD_DIR     = @build_dir@
-LOAD_EXT      = @load_ext@
-O             = @o@
-EXE           = @exe@
+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
-LN_S          = @lns@
-PERL          = @perl@
-RM_RF         = @rm_rf@
-CP            = @cp@
-PARROT        = ../../parrot at exe@
-CAT           = @cat@
-BUILD_DYNPMC  = $(PERL) $(BUILD_DIR)/tools/build/dynpmc.pl
-RECONFIGURE   = $(PERL) $(BUILD_DIR)/tools/dev/reconfigure.pl
-PBC_TO_EXE    = $(BUILD_DIR)/pbc_to_exe$(EXE)
-#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@
-
-## places to look for things
-PARROT_DYNEXT = $(BUILD_DIR)/runtime/parrot/dynext
-PGE_LIBRARY   = $(BUILD_DIR)/runtime/parrot/library/PGE
-PERL6GRAMMAR  = $(PGE_LIBRARY)/Perl6Grammar.pbc
-NQP           = $(BUILD_DIR)/compilers/nqp/nqp.pbc
-PCT           = $(BUILD_DIR)/runtime/parrot/library/PCT.pbc
+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@
 
-PMC_DIR       = src/pmc
-
-all: cardinal.pbc test.pir
-
-CARDINAL_GROUP = $(PMC_DIR)/cardinal_group$(LOAD_EXT)
-
-SOURCES = cardinal.pir \
+SOURCES := \
   src/parser/quote_expression.pir \
   src/gen_grammar.pir \
   src/gen_actions.pir \
   src/gen_builtins.pir \
-#  $(CARDINAL_GROUP)
+  cardinal.pir
 
-BUILTINS_PIR = \
+BUILTINS_PIR := \
   src/builtins/guts.pir \
   src/builtins/control.pir \
   src/builtins/say.pir \
@@ -70,57 +70,70 @@
   src/classes/Dir.pir \
   src/builtins/globals.pir \
   src/builtins/eval.pir \
-  src/classes/Continuation.pir \
+  src/classes/Continuation.pir
 
-# PMCS = cardinal
-# PMC_SOURCES = $(PMC_DIR)/cardinal.pmc
 
-# targets for building a standalone cardinal.
-# (We're not quite ready to make this a default target.)
-cardinal$(EXE): cardinal.pbc
-	$(PBC_TO_EXE) cardinal.pbc
+DOCS := README
 
-installable_cardinal$(EXE): cardinal.pbc
-	$(PBC_TO_EXE) cardinal.pbc --install
+BUILD_CLEANUPS := \
+  cardinal.pbc \
+  "src/gen_*.pir" \
+  "*.c" \
+  "*$(O)" \
+  cardinal at exe@ \
+#IF(win32):  parrot-cardinal.exe \
+#IF(win32):  parrot-cardinal.iss \
+#IF(win32):  "setup-parrot-*.exe" \
+  installable_cardinal at exe@
+
+TEST_CLEANUPS :=
 
 # the default target
-cardinal.pbc: $(PARROT) $(SOURCES)
+build: cardinal.pbc
+
+all: build cardinal at exe@ installable
+
+cardinal.pbc: $(SOURCES)
 	$(PARROT) $(PARROT_ARGS) -o cardinal.pbc cardinal.pir
 
-test.pir: $(PARROT) test.rb cardinal.pbc
-	$(PARROT) $(PARROT_ARGS) cardinal.pbc --target=pir --output=test.pir test.rb
+cardinal at exe@: cardinal.pbc
+	$(PBC_TO_EXE) cardinal.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) $(PCT) src/parser/actions.pm
+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
+	$(CAT) $(BUILTINS_PIR) > src/gen_builtins.pir
 
-$(CARDINAL_GROUP): $(PARROT) $(PMC_SOURCES)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) generate $(PMCS)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) compile $(PMCS)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) linklibs $(PMCS)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) copy --destination=$(PARROT_DYNEXT) $(PMCS)
+installable: installable_cardinal at exe@
+
+installable_cardinal at exe@: cardinal.pbc
+	$(PBC_TO_EXE) cardinal.pbc --install
 
-# regenerate the Makefile
 Makefile: config/makefiles/root.in
-	cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::languages --languages=cardinal
+	$(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 "  all:               cardinal.pbc"
+	@echo "  build:             cardinal.pbc"
 	@echo "                     This is the default."
+	@echo "  cardinal at exe@       Self-hosting binary not to be installed."
+	@echo "  all:               cardinal.pbc cardinal 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:"
@@ -132,8 +145,8 @@
 	@echo "  help:              Print this help message."
 	@echo ""
 
-test: all
-	$(PERL) t/harness
+test: build
+	$(PERL) -I$(LIB_DIR)/tools/lib t/harness
 
 arraytest: all
 	$(PERL) t/harness --tests-from-dir=array
@@ -141,37 +154,43 @@
 hashtest: all
 	$(PERL) t/harness --tests-from-dir=hash
 
-# this target has nothing to do
-testclean:
-
-CLEANUPS = \
-  cardinal.pbc \
-  cardinal.c \
-  *.manifest \
-  *.pdb \
-  cardinal$(O) \
-  cardinal$(EXE) \
-  installable_cardinal$(EXE) \
-  src/gen_grammar.pir \
-  src/gen_actions.pir \
-  src/gen_builtins.pir \
-  $(PMC_DIR)/*.h \
-  $(PMC_DIR)/*.c \
-  $(PMC_DIR)/*.dump \
-  $(PMC_DIR)/*$(O) \
-  $(PMC_DIR)/*$(LOAD_EXT) \
-  $(PMC_DIR)/*.exp \
-  $(PMC_DIR)/*.ilk \
-  $(PMC_DIR)/*.manifest \
-  $(PMC_DIR)/*.pdb \
-  $(PMC_DIR)/*.lib \
+# basic run for missing libs
+test-installable: installable
+	echo "1" | ./installable_cardinal at exe@
+
+install: installable
+	$(CP) installable_cardinal at exe@ $(BIN_DIR)/parrot-cardinal at exe@
+	$(CHMOD) 0755 $(BIN_DIR)/parrot-cardinal at exe@
+	-$(MKPATH) $(LIB_DIR)/languages/cardinal
+	$(CP) cardinal.pbc $(LIB_DIR)/languages/cardinal/cardinal.pbc
+#	-$(MKPATH) $(MANDIR)/man1
+#	$(POD2MAN) doc/running.pod > $(MANDIR)/man1/parrot-cardinal.1
+#	-$(MKPATH) $(DOC_DIR)/languages/cardinal
+#	$(CP) $(DOCS) $(DOC_DIR)/languages/cardinal
+
+uninstall:
+	$(RM_F) $(BIN_DIR)/parrot-cardinal at exe@
+	$(RM_RF) $(LIB_DIR)/languages/cardinal
+#	$(RM_F) $(MANDIR)/man1/parrot-cardinal.1
+#	$(RM_RF) $(DOC_DIR)/languages/cardinal
+
+win32-inno-installer: installable
+#	-$(MKPATH) man/man1
+#	$(POD2MAN) doc/running.pod > man/man1/parrot-cardinal.1
+#	-$(MKPATH) man/html
+#	pod2html --infile doc/running.pod --outfile man/html/parrot-cardinal.html
+	$(CP) installable_cardinal at exe@ parrot-cardinal.exe
+	$(PERL) $(LIB_DIR)/tools/dev/mk_inno_language.pl cardinal
+	iscc parrot-cardinal.iss
 
+testclean:
+	$(RM_F) $(TEST_CLEANUPS)
 
 clean:
-	$(RM_RF) $(CLEANUPS)
+	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS)
 
-realclean: clean
-	$(RM_RF) Makefile
+realclean:
+	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS) Makefile
 
 distclean: realclean
 
@@ -179,3 +198,4 @@
 #   mode: makefile
 # End:
 # vim: ft=make:
+

Modified: trunk/languages/cardinal/src/classes/Object.pir
==============================================================================
--- trunk/languages/cardinal/src/classes/Object.pir	Wed Mar 11 18:24:29 2009	(r37313)
+++ trunk/languages/cardinal/src/classes/Object.pir	Wed Mar 11 18:31:02 2009	(r37314)
@@ -288,7 +288,6 @@
 
 =cut
 
-.include 'library/dumper.pir'
 .sub 'methods' :method
     $P0 = class self
     $P1 = $P0.'methods'()


More information about the parrot-commits mailing list