tagged release 0.7.1
[parrot.git] / languages / perl6 / config / makefiles / root.in
blobbb4efcb85fd52e95790ef73f658354ea45c6dc1e
1 # $Id$
3 # arguments we want to run parrot with
4 PARROT_ARGS =
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
13 PMC_DIR       = src/pmc
14 OPSDIR        = src/ops
15 OPSLIB        = perl6
16 OPS_FILE      = src/ops/perl6.ops
18 # Set up extensions
19 LOAD_EXT      = @load_ext@
20 O             = @o@
21 EXE           = @exe@
23 # Setup some commands
24 MAKE          = @make_c@
25 PERL          = @perl@
26 RM_F          = @rm_f@
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
39 xmas: perl6$(EXE)
41 SOURCES = perl6.pir \
42   src/gen_grammar.pir \
43   src/gen_actions.pir \
44   src/gen_builtins.pir \
45   src/parser/expression.pir \
46   src/parser/quote_expression.pir \
47   $(PERL6_GROUP) \
48   src/ops/perl6_ops$(LOAD_EXT)
50 BUILTINS_PIR = \
51   src/classes/Object.pir \
52   src/classes/Any.pir \
53   src/classes/Scalar.pir \
54   src/classes/Bool.pir \
55   src/classes/Str.pir \
56   src/classes/Num.pir \
57   src/classes/Int.pir \
58   src/classes/Order.pir \
59   src/classes/Complex.pir \
60   src/classes/IO.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 \
69   src/classes/Sub.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 \
91   src/builtins/io.pir \
92   src/builtins/match.pir \
93   src/builtins/math.pir \
94   src/builtins/misc.pir \
95   src/builtins/named-unary.pir \
96   src/builtins/op.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
115 # the default target
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
154 help:
155         @echo ""
156         @echo "Following targets are available for the user:"
157         @echo ""
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)."
162         @echo ""
163         @echo "Testing:"
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."
172         @echo ""
173         @echo "Cleaning:"
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."
177         @echo ""
178         @echo "Misc:"
179         @echo "  help:              Print this help message."
180         @echo ""
182 test    : coretest codetest
184 coretest: all
185         $(PERL) t/harness t/00-parrot t/01-sanity
186         prove t/pmc
188 codetest:
189         $(MAKE) $(BUILD_DIR) codetest
191 # this target has nothing to do
192 testclean:
194 testtest: all test
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
202 spectest: all t/spec
203         -cd t/spec && svn up
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
208         -cd t/spec && svn up
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
223 sometests: all
224         @$(HARNESS_WITH_FUDGE_JOBS) $(TESTFILES)
226 # Run a single test
227 t/*.t t/*/*.t t/*/*/*.t: all
228         @$(HARNESS_WITH_FUDGE) --verbosity=1 $@
230 t/localtest.data:
231         $(PERL) -MExtUtils::Command -e test_f $@
233 t/spec:
234         svn co http:////svn.pugscode.org//pugs//t//spec t/spec
236 CLEANUPS = \
237   perl6.pbc \
238   perl6.c \
239   perl6$(O) \
240   perl6$(EXE) \
241   installable_perl6$(EXE) \
242   Test.pir \
243   src/gen_grammar.pir \
244   src/gen_actions.pir \
245   src/gen_builtins.pir \
246   $(PMC_DIR)/*.h \
247   $(PMC_DIR)/*.c \
248   $(PMC_DIR)/*.dump \
249   $(PMC_DIR)/*$(O) \
250   $(PMC_DIR)/*$(LOAD_EXT) \
251   $(PMC_DIR)/*.exp \
252   $(PMC_DIR)/*.ilk \
253   $(PMC_DIR)/*.manifest \
254   $(PMC_DIR)/*.pdb \
255   $(PMC_DIR)/*.lib \
256   $(PMC_DIR)/mutable.pmc \
257   $(OPSDIR)/*.h \
258   $(OPSDIR)/*.c \
259   $(OPSDIR)/*$(O) \
260   $(OPSDIR)/*$(LOAD_EXT) \
262 clean:
263         $(RM_F) $(CLEANUPS)
265 realclean: clean
266         $(RM_F) src/utils/Makefile Makefile
268 distclean: realclean