Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rerun mk_language_shell.pl. Courtesy of fperrad.

  • Loading branch information...
commit 9021e34601c43a37e9a820bfe77629ec6cd539cd 1 parent 90167c8
@bschmalhofer authored
Showing with 176 additions and 41 deletions.
  1. +12 −1 .gitignore
  2. +50 −6 Configure.pl
  3. +114 −34 config/makefiles/root.in
View
13 .gitignore
@@ -1,2 +1,13 @@
Makefile
-lazy.pbc
+
+*.pbc
+*.c
+*.o
+*.obj
+*.iss
+*.exe
+lazy
+installable_lazy
+
+man
+*.tmp
View
56 Configure.pl
@@ -5,13 +5,57 @@
use warnings;
use 5.008;
-my $build_dir = '../..';
-my $hll = 'lazy-k';
-my $cmd = qq{$^X -Ilib tools/dev/reconfigure.pl --step=gen::languages --languages=$hll};
+# Get a list of parrot-configs to invoke.
+my @parrot_config_exe = (
+ 'parrot/parrot_config',
+ '../../parrot_config',
+ 'parrot_config',
+);
-print "Running '$cmd' in $build_dir\n";
-chdir $build_dir;
-`$cmd`
+# 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
View
148 config/makefiles/root.in
@@ -1,53 +1,133 @@
-# $Id$
+## $Id$
-# Makefile for languages/lazy-k
+## arguments we want to run parrot with
+PARROT_ARGS :=
-# configuration settings
-BUILD_DIR = @build_dir@
+## configuration settings
+VERSION := @versiondir@
+BIN_DIR := @bin_dir@
+LIB_DIR := @lib_dir@$(VERSION)
+DOC_DIR := @doc_dir@$(VERSION)
+MANDIR := @mandir@$(VERSION)
-# Set up commands
-PERL = @perl@
-RM_F = @rm_f@
-PARROT = $(BUILD_DIR)/parrot@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@
+# Set up extensions
+O := @o@
-# The default target
-default: build
+## 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 := ../../parrot@exe@
+PBC_TO_EXE := ../../pbc_to_exe@exe@
+#IF(darwin):
+#IF(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
+#IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
-help :
+DOCS := README
+
+build: lazy.pbc
+
+all: build lazy@exe@ installable
+
+lazy.pbc: lazy.pir
+ $(PARROT) $(PARROT_ARGS) -o lazy.pbc lazy.pir
+
+lazy@exe@: lazy.pbc
+ $(PBC_TO_EXE) lazy.pbc
+
+
+installable: installable_lazy@exe@
+
+installable_lazy@exe@: lazy.pbc
+ $(PBC_TO_EXE) lazy.pbc --install
+
+# regenerate the Makefile
+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: Build lazy.pbc."
- @echo " This is the default target."
+ @echo " build: lazy.pbc"
+ @echo " This is the default."
+ @echo " lazy@exe@ Self-hosting binary not to be installed."
+ @echo " all: lazy.pbc lazy@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 " clean: Clean up."
- @echo ""
- @echo " realclean: Clean and remove Makefile."
+ @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 ""
-# regenerate the Makefile
-Makefile: config/makefiles/root.in
- $(PERL) Configure.pl
+test: build
+ $(PERL) t/harness
-# Compilation:
-build: lazy.pbc
+install: installable
+ $(CP) installable_lazy@exe@ $(BIN_DIR)/parrot-lazy@exe@
+ $(CHMOD) 0755 $(BIN_DIR)/parrot-lazy@exe@
+ -$(MKPATH) $(LIB_DIR)/languages/lazy-k
+ $(CP) lazy.pbc $(LIB_DIR)/languages/lazy-k/lazy.pbc
+ -$(MKPATH) $(MANDIR)/man1
+ $(POD2MAN) lazy.pir > $(MANDIR)/man1/parrot-lazy.1
+ -$(MKPATH) $(DOC_DIR)/languages/lazy-k
+ $(CP) $(DOCS) $(DOC_DIR)/languages/lazy-k
-lazy.pbc:
- $(PARROT) -o lazy.pbc lazy.pir
+uninstall:
+ $(RM_F) $(BIN_DIR)/parrot-lazy-k@exe@
+ $(RM_RF) $(LIB_DIR)/languages/lazy-k
+ $(RM_F) $(MANDIR)/man1/parrot-lazy-k.1
+ $(RM_RF) $(DOC_DIR)/languages/lazy-k
-# cleaning up
-clean:
- $(RM_F) lazy.pbc
+win32-inno-installer: installable
+ -$(MKPATH) man/man1
+ $(POD2MAN) lazy.pir > man/man1/parrot-lazy.1
+ -$(MKPATH) man/html
+ pod2html --infile lazy.pir --outfile man/html/parrot-lazy.html
+ $(CP) installable_lazy@exe@ parrot-lazy.exe
+ $(PERL) $(LIB_DIR)/tools/dev/mk_inno_language.pl lazy-k
+ iscc parrot-lazy-k.iss
-realclean: clean
- $(RM_F) Makefile
+# clean intermediate test files
+testclean:
+
+CLEANUPS := \
+ lazy.pbc \
+ "*.c" \
+ "*$(O)" \
+ lazy@exe@ \
+#IF(win32): parrot-lazy.exe \
+#IF(win32): parrot-lazy-k.iss \
+#IF(win32): "setup-parrot-*.exe" \
+ installable_lazy@exe@
+
+clean: testclean
+ $(RM_F) $(CLEANUPS)
+
+realclean: testclean
+ $(RM_F) $(CLEANUPS) Makefile
+
+distclean: realclean
+
+# Local variables:
+# mode: makefile
+# End:
+# vim: ft=make:
-# testing
-test: build
- $(PERL) t/harness

0 comments on commit 9021e34

Please sign in to comment.
Something went wrong with that request. Please try again.