tagged release 0.6.4
[parrot.git] / languages / perl6 / config / makefiles / root.in
blob180f6abf5f6f3d08d8bc7d9daf853890ecc8bb54
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
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/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 \
89   src/builtins/io.pir \
90   src/builtins/match.pir \
91   src/builtins/math.pir \
92   src/builtins/misc.pir \
93   src/builtins/named-unary.pir \
94   src/builtins/op.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
112 # the default target
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
145 help:
146         @echo ""
147         @echo "Following targets are available for the user:"
148         @echo ""
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)."
153         @echo ""
154         @echo "Testing:"
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."
163         @echo ""
164         @echo "Cleaning:"
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."
168         @echo ""
169         @echo "Misc:"
170         @echo "  help:              Print this help message."
171         @echo ""
173 test    : coretest codetest
175 coretest: all
176         $(PERL) t/harness t/00-parrot t/01-sanity
178 codetest:
179         $(MAKE) $(BUILD_DIR) codetest
181 # this target has nothing to do
182 testclean:
184 testtest: all test
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
189 spectest: all t/spec
190         -cd t/spec && svn up
191         $(PERL) t/harness --fudge --keep-exit-code t/spec
193 spectest_regression: all t/spec t/spectest_regression.data
194         -cd t/spec && svn up
195         $(PERL) t/harness \
196         --configfudge \
197         --tests-from-file=t/spectest_regression.data \
198         --keep-exit-code \
199         t/spec/ \
201 fulltest: coretest spectest_regression codetest
203 localtest: all t/spec t/localtest.data
204         $(PERL) t/harness \
205         --configfudge \
206         --tests-from-file=t/localtest.data \
207         --keep-exit-code \
208         t/spec/ \
210 t/localtest.data:
211         $(PERL) -MExtUtils::Command -e test_f $@
213 t/spec:
214         svn co http:////svn.pugscode.org//pugs//t//spec t/spec
216 CLEANUPS = \
217   perl6.pbc \
218   perl6.c \
219   perl6$(O) \
220   perl6$(EXE) \
221   src/gen_grammar.pir \
222   src/gen_actions.pir \
223   src/gen_builtins.pir \
224   $(PMC_DIR)/*.h \
225   $(PMC_DIR)/*.c \
226   $(PMC_DIR)/*.dump \
227   $(PMC_DIR)/*$(O) \
228   $(PMC_DIR)/*$(LOAD_EXT) \
229   $(PMC_DIR)/*.exp \
230   $(PMC_DIR)/*.ilk \
231   $(PMC_DIR)/*.manifest \
232   $(PMC_DIR)/*.pdb \
233   $(PMC_DIR)/*.lib \
234   $(PMC_DIR)/mutable.pmc \
235   $(OPSDIR)/*.h \
236   $(OPSDIR)/*.c \
237   $(OPSDIR)/*$(O) \
238   $(OPSDIR)/*$(LOAD_EXT) \
240 clean:
241         $(RM_F) $(CLEANUPS)
243 realclean: clean
244         $(RM_F) src/utils/Makefile Makefile
246 distclean: realclean