3 # arguments we want to run parrot with
6 # places to look for things
7 BUILD_DIR = @build_dir@
8 PARROT_DYNEXT = $(BUILD_DIR)/runtime/parrot/dynext
9 PGE_LIBRARY = $(BUILD_DIR)/runtime/parrot/library/PGE
10 PERL6GRAMMAR = $(PGE_LIBRARY)/Perl6Grammar.pbc
11 NQP = $(BUILD_DIR)/compilers/nqp/nqp.pbc
12 PCT = $(BUILD_DIR)/runtime/parrot/library/PCT.pbc
16 OPS_FILE = src/ops/perl6.ops
27 PARROT = ../../parrot$(EXE)
28 CAT = $(PERL) -MExtUtils::Command -e cat
29 BUILD_DYNPMC = $(PERL) $(BUILD_DIR)/tools/build/dynpmc.pl
30 BUILD_DYNOPS = $(PERL) $(BUILD_DIR)/tools/build/dynoplibs.pl
31 RECONFIGURE = $(PERL) $(BUILD_DIR)/tools/dev/reconfigure.pl
32 PBC_TO_EXE = $(BUILD_DIR)/pbc_to_exe$(EXE)
33 #CONDITIONED_LINE(darwin):
34 #CONDITIONED_LINE(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
35 #CONDITIONED_LINE(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
44 src/gen_builtins.pir \
45 src/parser/expression.pir \
46 src/parser/quote_expression.pir \
48 src/ops/perl6_ops$(LOAD_EXT)
51 src/classes/Object.pir \
53 src/classes/Scalar.pir \
54 src/classes/Bool.pir \
58 src/classes/Order.pir \
59 src/classes/Complex.pir \
61 src/classes/List.pir \
62 src/classes/Array.pir \
63 src/classes/Mapping.pir \
64 src/classes/Hash.pir \
65 src/classes/Range.pir \
66 src/classes/Code.pir \
67 src/classes/Block.pir \
68 src/classes/Routine.pir \
70 src/classes/Method.pir \
71 src/classes/Junction.pir \
72 src/classes/Failure.pir \
73 src/classes/Role.pir \
74 src/classes/Pair.pir \
75 src/classes/Whatever.pir \
76 src/classes/Capture.pir \
77 src/classes/Signature.pir \
78 src/classes/Subset.pir \
79 src/classes/Grammar.pir \
80 src/builtins/globals.pir \
81 src/builtins/any-list.pir \
82 src/builtins/any-num.pir \
83 src/builtins/any-str.pir \
84 src/builtins/assign.pir \
85 src/builtins/cmp.pir \
86 src/builtins/control.pir \
87 src/builtins/enums.pir \
88 src/builtins/guts.pir \
90 src/builtins/match.pir \
91 src/builtins/math.pir \
92 src/builtins/misc.pir \
93 src/builtins/named-unary.pir \
95 src/builtins/parrot.pir \
96 src/builtins/system.pir \
97 src/builtins/traits.pir \
99 $(PMC_DIR)/mutable.pmc : $(PMC_DIR)/mutable_pmc.template build/gen_mutable_pmc.pl
100 $(PERL) build/gen_mutable_pmc.pl $(PMC_DIR)/mutable_pmc.template \
101 $(PMC_DIR)/mutable.pmc
103 PMCS = perl6str mutable perl6scalar mutablevar
104 PMC_SOURCES = $(PMC_DIR)/perl6str.pmc $(PMC_DIR)/mutable.pmc $(PMC_DIR)/perl6scalar.pmc $(PMC_DIR)/mutablevar.pmc
105 PERL6_GROUP = $(PMC_DIR)/perl6_group$(LOAD_EXT)
107 # targets for building a standalone perl6.
108 # (We're not quite ready to make this a default target.)
109 perl6$(EXE): perl6.pbc
110 $(PBC_TO_EXE) perl6.pbc
113 perl6.pbc: $(PARROT) $(SOURCES)
114 $(PARROT) $(PARROT_ARGS) -o perl6.pbc perl6.pir
116 src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg src/parser/grammar-oper.pg
117 $(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
118 --output=src/gen_grammar.pir \
119 src/parser/grammar.pg src/parser/grammar-oper.pg
121 src/gen_actions.pir: $(NQP) $(PCT) src/parser/actions.pm
122 $(PARROT) $(PARROT_ARGS) $(NQP) --output=src/gen_actions.pir \
123 --encoding=fixed_8 --target=pir src/parser/actions.pm
125 src/gen_builtins.pir: $(BUILTINS_PIR)
126 $(CAT) $(BUILTINS_PIR) >src/gen_builtins.pir
128 $(PERL6_GROUP): $(PARROT) $(PMC_SOURCES)
129 cd $(PMC_DIR) && $(BUILD_DYNPMC) generate $(PMCS)
130 cd $(PMC_DIR) && $(BUILD_DYNPMC) compile $(PMCS)
131 cd $(PMC_DIR) && $(BUILD_DYNPMC) linklibs $(PMCS)
132 cd $(PMC_DIR) && $(BUILD_DYNPMC) copy --destination=$(PARROT_DYNEXT) $(PMCS)
134 src/ops/perl6_ops$(LOAD_EXT) : $(OPS_FILE)
135 @cd $(OPSDIR) && $(BUILD_DYNOPS) generate $(OPSLIB)
136 @cd $(OPSDIR) && $(BUILD_DYNOPS) compile $(OPSLIB)
137 @cd $(OPSDIR) && $(BUILD_DYNOPS) linklibs $(OPSLIB)
138 @cd $(OPSDIR) && $(BUILD_DYNOPS) copy "--destination=$(PARROT_DYNEXT)" $(OPSLIB)
140 # regenerate the Makefile
141 Makefile: config/makefiles/root.in config/makefiles/utils.in
142 cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::languages --languages=perl6
144 # This is a listing of all targets, that are meant to be called by users
147 @echo "Following targets are available for the user:"
149 @echo " all: perl6.pbc"
150 @echo " This is the default."
151 @echo " perl6$(EXE): Some want a pony, others are satisfied with an executable."
152 @echo " xmas: Christmas is when Perl 6 is released. Alias of perl6$(EXE)."
155 @echo " test: Run coretest and codetest."
156 @echo " coretest: Run rakudo's core tests."
157 @echo " codetest: Run Parrot's code tests."
158 @echo " testclean: Clean up test results."
159 @echo " spectest: Run the official Perl 6 tests."
160 @echo " spectest_regression: Run the tests of the official test suite that are known to pass."
161 @echo " localtest: Run the official tests given in t/localtest.data."
162 @echo " fulltest: Run coretest, spectest_regression, and codetest."
165 @echo " clean: Basic cleaning up."
166 @echo " realclean: Removes also files generated by 'Configure.pl'."
167 @echo " distclean: Removes also anything built, in theory."
170 @echo " help: Print this help message."
173 test : coretest codetest
176 $(PERL) t/harness t/00-parrot t/01-sanity
179 $(MAKE) $(BUILD_DIR) codetest
181 # this target has nothing to do
185 $(PERL) t/harness t/02-test-pm
187 # NOTE: eventually, we should remove --keep-exit-code and --fudge
188 # as the goal is that all tests must pass without fudge
191 $(PERL) t/harness --fudge --keep-exit-code t/spec
193 spectest_regression: all t/spec t/spectest_regression.data
197 --tests-from-file=t/spectest_regression.data \
201 fulltest: coretest spectest_regression codetest
203 localtest: all t/spec t/localtest.data
206 --tests-from-file=t/localtest.data \
211 $(PERL) -MExtUtils::Command -e test_f $@
214 svn co http:////svn.pugscode.org//pugs//t//spec t/spec
221 src/gen_grammar.pir \
222 src/gen_actions.pir \
223 src/gen_builtins.pir \
228 $(PMC_DIR)/*$(LOAD_EXT) \
231 $(PMC_DIR)/*.manifest \
234 $(PMC_DIR)/mutable.pmc \
238 $(OPSDIR)/*$(LOAD_EXT) \
244 $(RM_F) src/utils/Makefile Makefile