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@
37 all: perl6.pbc Test.pir
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/classes/Module.pir \
81 src/builtins/globals.pir \
82 src/builtins/any-list.pir \
83 src/builtins/any-num.pir \
84 src/builtins/any-str.pir \
85 src/builtins/assign.pir \
86 src/builtins/cmp.pir \
87 src/builtins/control.pir \
88 src/builtins/eval.pir \
89 src/builtins/enums.pir \
90 src/builtins/guts.pir \
92 src/builtins/match.pir \
93 src/builtins/math.pir \
94 src/builtins/misc.pir \
95 src/builtins/named-unary.pir \
97 src/builtins/parrot.pir \
98 src/builtins/system.pir \
99 src/builtins/traits.pir \
101 $(PMC_DIR)/mutable.pmc : $(PMC_DIR)/mutable_pmc.template build/gen_mutable_pmc.pl
102 $(PERL) build/gen_mutable_pmc.pl $(PMC_DIR)/mutable_pmc.template \
103 $(PMC_DIR)/mutable.pmc
105 PMCS = perl6str mutable perl6scalar mutablevar perl6multisub
106 PMC_SOURCES = $(PMC_DIR)/perl6str.pmc $(PMC_DIR)/mutable.pmc $(PMC_DIR)/perl6scalar.pmc \
107 $(PMC_DIR)/mutablevar.pmc $(PMC_DIR)/perl6multisub.pmc
108 PERL6_GROUP = $(PMC_DIR)/perl6_group$(LOAD_EXT)
110 # targets for building a standalone perl6.
111 # (We're not quite ready to make this a default target.)
112 perl6$(EXE): perl6.pbc
113 $(PBC_TO_EXE) perl6.pbc
116 perl6.pbc: $(PARROT) $(SOURCES)
117 $(PARROT) $(PARROT_ARGS) -o perl6.pbc perl6.pir
119 installable_perl6$(EXE): perl6.pbc
120 $(PBC_TO_EXE) perl6.pbc --install
122 Test.pir: Test.pm perl6.pbc
123 $(PARROT) $(PARROT_ARGS) perl6.pbc --target=pir --output=Test.pir Test.pm
125 src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg src/parser/grammar-oper.pg
126 $(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
127 --output=src/gen_grammar.pir \
128 src/parser/grammar.pg src/parser/grammar-oper.pg
130 src/gen_actions.pir: $(NQP) $(PCT) src/parser/actions.pm
131 $(PARROT) $(PARROT_ARGS) $(NQP) --output=src/gen_actions.pir \
132 --encoding=fixed_8 --target=pir src/parser/actions.pm
134 src/gen_builtins.pir: $(BUILTINS_PIR)
135 $(CAT) $(BUILTINS_PIR) >src/gen_builtins.pir
137 $(PERL6_GROUP): $(PARROT) $(PMC_SOURCES)
138 cd $(PMC_DIR) && $(BUILD_DYNPMC) generate $(PMCS)
139 cd $(PMC_DIR) && $(BUILD_DYNPMC) compile $(PMCS)
140 cd $(PMC_DIR) && $(BUILD_DYNPMC) linklibs $(PMCS)
141 cd $(PMC_DIR) && $(BUILD_DYNPMC) copy --destination=$(PARROT_DYNEXT) $(PMCS)
143 src/ops/perl6_ops$(LOAD_EXT) : $(OPS_FILE)
144 @cd $(OPSDIR) && $(BUILD_DYNOPS) generate $(OPSLIB)
145 @cd $(OPSDIR) && $(BUILD_DYNOPS) compile $(OPSLIB)
146 @cd $(OPSDIR) && $(BUILD_DYNOPS) linklibs $(OPSLIB)
147 @cd $(OPSDIR) && $(BUILD_DYNOPS) copy "--destination=$(PARROT_DYNEXT)" $(OPSLIB)
149 # regenerate the Makefile
150 Makefile: config/makefiles/root.in config/makefiles/utils.in
151 cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::languages --languages=perl6
153 # This is a listing of all targets, that are meant to be called by users
156 @echo "Following targets are available for the user:"
158 @echo " all: perl6.pbc"
159 @echo " This is the default."
160 @echo " perl6$(EXE): Some want a pony, others are satisfied with an executable."
161 @echo " xmas: Christmas is when Perl 6 is released. Alias of perl6$(EXE)."
164 @echo " test: Run coretest and codetest."
165 @echo " coretest: Run rakudo's core tests."
166 @echo " codetest: Run Parrot's code tests."
167 @echo " testclean: Clean up test results."
168 @echo " spectest: Run the official Perl 6 tests."
169 @echo " spectest_regression: Run the tests of the official test suite that are known to pass."
170 @echo " localtest: Run the official tests given in t/localtest.data."
171 @echo " fulltest: Run coretest, spectest_regression, and codetest."
174 @echo " clean: Basic cleaning up."
175 @echo " realclean: Removes also files generated by 'Configure.pl'."
176 @echo " distclean: Removes also anything built, in theory."
179 @echo " help: Print this help message."
182 test : coretest codetest
185 $(PERL) t/harness t/00-parrot t/01-sanity
189 $(MAKE) $(BUILD_DIR) codetest
191 # this target has nothing to do
195 $(PERL) t/harness t/02-test-pm
197 # NOTE: eventually, we should remove --keep-exit-code and --fudge
198 # as the goal is that all tests must pass without fudge
199 HARNESS_WITH_FUDGE = $(PERL) t/harness --fudge --keep-exit-code
200 HARNESS_WITH_FUDGE_JOBS = $(HARNESS_WITH_FUDGE) --jobs
204 $(HARNESS_WITH_FUDGE_JOBS) t/spec
206 # Run the spectests that we know work.
207 spectest_regression: all t/spec t/spectest_regression.data
209 $(HARNESS_WITH_FUDGE_JOBS) --tests-from-file=t/spectest_regression.data
211 fulltest: coretest spectest_regression codetest
213 # Run the tests in t/localtest.data
214 localtest: all t/spec t/localtest.data
215 @$(HARNESS_WITH_FUDGE_JOBS) --tests-from-file=t/localtest.data
217 # Run the tests in t/localtest.data with a higher verbosity
218 localtest_loud: all t/spec t/localtest.data
219 @$(HARNESS_WITH_FUDGE) --tests-from-file=t/localtest.data --verbosity=1
221 # Run many tests of your choise.
222 # make somtests TESTFILES=t/foo/bar
224 @$(HARNESS_WITH_FUDGE_JOBS) $(TESTFILES)
227 t/*.t t/*/*.t t/*/*/*.t: all
228 @$(HARNESS_WITH_FUDGE) --verbosity=1 $@
231 $(PERL) -MExtUtils::Command -e test_f $@
234 svn co http:////svn.pugscode.org//pugs//t//spec t/spec
241 installable_perl6$(EXE) \
243 src/gen_grammar.pir \
244 src/gen_actions.pir \
245 src/gen_builtins.pir \
250 $(PMC_DIR)/*$(LOAD_EXT) \
253 $(PMC_DIR)/*.manifest \
256 $(PMC_DIR)/mutable.pmc \
260 $(OPSDIR)/*$(LOAD_EXT) \
266 $(RM_F) src/utils/Makefile Makefile