Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
114 lines (87 sloc) 2.74 KB
## arguments we want to run parrot with
PARROT_ARGS =
## configuration settings
INCLUDE_DIR = @includedir@@versiondir@
LIB_DIR = @libdir@@versiondir@
SRC_DIR = @srcdir@@versiondir@
TOOLS_DIR = @libdir@@versiondir@/tools/lib
LOAD_EXT = @load_ext@
O = @o@
## Setup some commands
PERL = @perl@
RM_F = @rm_f@
CP = @cp@
CAT = @cat@
PARROT = @bindir@/parrot@exe@
NQP = $(PARROT) $(LIB_DIR)/languages/nqp/nqp.pbc
PBC_TO_EXE = @bindir@/pbc_to_exe
HARNESS = $(PERL) t/harness
## places to look for things
PARROT_DYNEXT = $(LIB_DIR)/dynext
PERL6GRAMMAR = $(LIB_DIR)/library/PGE/Perl6Grammar.pbc
PCT = $(LIB_DIR)/PCT.pbc
PMC_DIR = src/pmc
all: matrixy@exe@
SOURCES = \
matrixy.pir src/gen_grammar.pir \
src/gen_actions.pir src/gen_builtins.pir \
src/gen_internals.pir src/gen_classes.pir
BUILTINS_PIR = src/builtins/*.pir
INTERNALS_PIR = src/internals/*.pir
CLASSES_PIR = src/classes/*.pir
# the default target
matrixy@exe@: matrixy.pbc
$(PBC_TO_EXE) matrixy.pbc
matrixy.pbc: $(SOURCES)
$(PARROT) $(PARROT_ARGS) -o matrixy.pbc matrixy.pir
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: src/parser/actions.pm
$(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
src/gen_internals.pir: $(INTERNALS_PIR)
$(CAT) $(INTERNALS_PIR) >src/gen_internals.pir
src/gen_classes.pir: $(CLASSES_PIR)
$(CAT) $(CLASSES_PIR) >src/gen_classes.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: matrixy.pbc"
@echo " This is the default."
@echo "Testing:"
@echo " test: Run the test suite."
@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
$(HARNESS) t/*.t && $(HARNESS) t/syntax/*.t t/functions/*.t t/parrot/*.t
install: all
# plaaceholder, we don't install yet.
CLEANUPS = \
matrixy.pbc \
matrixy.c \
matrixy$(O) \
matrixy@exe@ \
src/gen_*.pir
clean:
$(RM_F) $(CLEANUPS)
realclean: clean
$(RM_F) Makefile
distclean: realclean
# Local variables:
# mode: makefile
# End:
# vim: ft=make: