[svn:languages] r61 - in ook/trunk: . config/makefiles

fperrad at svn.parrot.org fperrad at svn.parrot.org
Sun Mar 15 13:27:55 UTC 2009


Author: fperrad
Date: Sun Mar 15 13:27:55 2009
New Revision: 61
URL: https://trac.parrot.org/languages/changeset/61

Log:
[ook] re-run mk_language_shell.pl

Added:
   ook/trunk/Configure.pl   (contents, props changed)
Modified:
   ook/trunk/   (props changed)
   ook/trunk/config/makefiles/root.in

Added: ook/trunk/Configure.pl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ ook/trunk/Configure.pl	Sun Mar 15 13:27:55 2009	(r61)
@@ -0,0 +1,66 @@
+# 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:
+

Modified: ook/trunk/config/makefiles/root.in
==============================================================================
--- ook/trunk/config/makefiles/root.in	Sun Mar 15 13:12:10 2009	(r60)
+++ ook/trunk/config/makefiles/root.in	Sun Mar 15 13:27:55 2009	(r61)
@@ -1,60 +1,137 @@
 # Copyright (C) 2003-2009, Parrot Foundation.
 # $Id$
 
-# Makefile for languages/ook
+## arguments we want to run parrot with
+PARROT_ARGS   :=
 
-# Set up of commands
-PARROT        = ../../parrot
-PERL          = @perl@
-RM_F          = @rm_f@
-RECONFIGURE   = $(PERL) @build_dir@/tools/dev/reconfigure.pl
-#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@
+## 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@
+
+## Setup some commands
+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@
+
+DOCS := README
+
+BUILD_CLEANUPS := \
+  ook.pbc \
+  "*.c" \
+  "*$(O)" \
+  ook at exe@ \
+#IF(win32):  parrot-ook.exe \
+#IF(win32):  parrot-ook.iss \
+#IF(win32):  "setup-parrot-*.exe" \
+  installable_ook at exe@
+
+TEST_CLEANUPS := \
+  "*.out" \
+
+# the default target
+build: ook.pbc
+
+all: build ook at exe@ installable
+
+ook.pbc: ook.pasm
+	$(PARROT) $(PARROT_ARGS) -o ook.pbc ook.pasm
 
-# Set up directories
-BUILD_DIR     = @build_dir@
+ook at exe@: ook.pbc
+	$(PBC_TO_EXE) ook.pbc
 
-default: all
+installable: installable_ook at exe@
 
-help :
+installable_ook at exe@: ook.pbc
+	$(PBC_TO_EXE) ook.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:             Create ook.pbc"
+	@echo "  build:             ook.pbc"
 	@echo "                     This is the default."
+	@echo "  ook at exe@            Self-hosting binary not to be installed."
+	@echo "  all:               ook.pbc ook 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 "  test:              run the test suite,"
+	@echo "Misc:"
+	@echo "  help:              Print this help message."
 	@echo ""
-	@echo "  clean:             clean up temporary files"
-	@echo ""
-	@echo "  realclean:         clean up generated files"
-	@echo ""
-	@echo "  help:              print this help message"
-
-# regenerate the Makefile
-Makefile: config/makefiles/root.in
-	cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::languages --languages=ook
-
-all: build
 
 test: build
-	$(PERL) -I../../lib t/harness
+	$(PERL) -I$(LIB_DIR)/tools/lib t/harness
+
+install: installable
+	$(CP) installable_ook at exe@ $(BIN_DIR)/parrot-ook at exe@
+	$(CHMOD) 0755 $(BIN_DIR)/parrot-ook at exe@
+	-$(MKPATH) $(LIB_DIR)/languages/ook
+	$(CP) ook.pbc $(LIB_DIR)/languages/ook/ook.pbc
+#	-$(MKPATH) $(MANDIR)/man1
+#	$(POD2MAN) doc/running.pod > $(MANDIR)/man1/parrot-ook.1
+	-$(MKPATH) $(DOC_DIR)/languages/ook
+	$(CP) $(DOCS) $(DOC_DIR)/languages/ook
+
+uninstall:
+	$(RM_F) $(BIN_DIR)/parrot-ook at exe@
+	$(RM_RF) $(LIB_DIR)/languages/ook
+#	$(RM_F) $(MANDIR)/man1/parrot-ook.1
+	$(RM_RF) $(DOC_DIR)/languages/ook
+
+win32-inno-installer: installable
+#	-$(MKPATH) man/man1
+#	$(POD2MAN) doc/running.pod > man/man1/parrot-ook.1
+#	-$(MKPATH) man/html
+#	pod2html --infile doc/running.pod --outfile man/html/parrot-ook.html
+	$(CP) installable_ook at exe@ parrot-ook.exe
+	$(PERL) -I$(LIB_DIR)/tools/lib $(LIB_DIR)/tools/dev/mk_inno_language.pl ook
+	iscc parrot-ook.iss
 
-build: ook.pasm
-	$(PARROT) -o ook.pbc ook.pasm
+testclean:
+	$(RM_F) $(TEST_CLEANUPS)
 
 clean:
-	$(RM_F) core \
-    "*.pbc" \
-    "*~" \
-    "hello.out" \
-    "foo.p*"
+	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS)
 
-realclean: clean
-	$(RM_F) Makefile
+realclean:
+	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS) Makefile
+
+distclean: realclean
 
 # Local variables:
 #   mode: makefile
 # End:
 # vim: ft=make:
+


More information about the parrot-commits mailing list