Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > cd14cddf3b3ceaf1193157472227757a > files > 623

parrot-doc-1.6.0-1mdv2010.0.i586.rpm

# Copyright (C) 2006-2009, Parrot Foundation.
# $Id: root.in 39165 2009-05-25 01:15:28Z jkeenan $

## arguments we want to run parrot with
PARROT_ARGS   :=

## configuration settings
VERSION       := @versiondir@
BIN_DIR       := @bindir@
LIB_DIR       := @libdir@$(VERSION)
DOC_DIR       := @docdir@$(VERSION)
MANDIR        := @mandir@$(VERSION)

# Set up extensions
LOAD_EXT      := @load_ext@
O             := @o@

# Various paths
PERL6GRAMMAR  := @build_dir@/runtime/parrot/library/PGE/Perl6Grammar.pbc
NQP           := @build_dir@/compilers/nqp/nqp.pbc
PCT           := @build_dir@/runtime/parrot/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        := @build_dir@/parrot@exe@
PBC_TO_EXE    := @build_dir@/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@

SOURCES := \
  src/gen_grammar.pir \
  src/gen_actions.pir \
  src/gen_builtins.pir \
  abc.pir

BUILTINS_PIR := \
  src/builtins/all.pir

DOCS := README

BUILD_CLEANUPS := \
  abc.pbc \
  "src/gen_*.pir" \
  "*.c" \
  "*$(O)" \
  abc@exe@ \
#IF(win32):  parrot-abc.exe \
#IF(win32):  parrot-abc.iss \
#IF(win32):  "setup-parrot-*.exe" \
  installable_abc@exe@

TEST_CLEANUPS := \
  "t/*.pir" \
  "t/*.out"

# the default target
build: abc.pbc

all: build abc@exe@ installable

abc.pbc: $(SOURCES)
	$(PARROT) $(PARROT_ARGS) -o abc.pbc abc.pir

abc@exe@: abc.pbc
	$(PBC_TO_EXE) abc.pbc

src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg src/parser/grammar-oper.pg
	$(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
	    --output=src/gen_grammar.pir \
	    src/parser/grammar.pg \
	    src/parser/grammar-oper.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_abc@exe@

installable_abc@exe@: abc.pbc
	$(PBC_TO_EXE) abc.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:             abc.pbc"
	@echo "                     This is the default."
	@echo "  abc@exe@            Self-hosting binary not to be installed."
	@echo "  all:               abc.pbc abc@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) t/harness

# basic run for missing libs
test-installable: installable
	echo "1" | ./installable_abc@exe@

install: installable
	$(CP) installable_abc@exe@ $(BIN_DIR)/parrot-abc@exe@
	$(CHMOD) 0755 $(BIN_DIR)/parrot-abc@exe@
	-$(MKPATH) $(LIB_DIR)/languages/abc
	$(CP) abc.pbc $(LIB_DIR)/languages/abc/abc.pbc
	-$(MKPATH) $(MANDIR)/man1
	$(POD2MAN) abc.pir > $(MANDIR)/man1/parrot-abc.1
	-$(MKPATH) $(DOC_DIR)/languages/abc
	$(CP) $(DOCS) $(DOC_DIR)/languages/abc

uninstall:
	$(RM_F) $(BIN_DIR)/parrot-abc@exe@
	$(RM_RF) $(LIB_DIR)/languages/abc
	$(RM_F) $(MANDIR)/man1/parrot-abc.1
	$(RM_RF) $(DOC_DIR)/languages/abc

win32-inno-installer: installable
	-$(MKPATH) man/man1
	$(POD2MAN) abc.pir > man/man1/parrot-abc.1
	-$(MKPATH) man/html
	pod2html --infile abc.pir --outfile man/html/parrot-abc.html
	$(CP) installable_abc@exe@ parrot-abc.exe
	$(PERL) -I@build_dir@/lib @build_dir@/tools/dev/mk_inno_language.pl abc
	iscc parrot-abc.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: