This repository has been archived by the owner on Jun 9, 2018. It is now read-only.
/
root.in
211 lines (169 loc) · 6.29 KB
/
root.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# Copyright (C) 2008-2009, Parrot Foundation.
# $Id$
## arguments we want to run parrot with
PARROT_ARGS :=
## configuration settings
VERSION := @versiondir@
BIN_DIR := @bindir@
LIB_DIR := @libdir@$(VERSION)
DOC_DIR := @docdir@$(VERSION)
MANDIR := @mandir@$(VERSION)
# Set up extensions
O := @o@
# Various paths
PERL6GRAMMAR := $(LIB_DIR)/library/PGE/Perl6Grammar.pbc
NQP := $(LIB_DIR)/languages/nqp/nqp.pbc
PCT := $(LIB_DIR)/library/PCT.pbc
## Setup some commands
PERL := @perl@
PROVE := @perl@ -I@build_dir@/lib
CAT := @cat@
CHMOD := @chmod@
CP := @cp@
MKPATH := @mkpath@
RM_F := @rm_f@
RM_RF := @rm_rf@
POD2MAN := pod2man
PARROT := $(BIN_DIR)/parrot@exe@
PBC_TO_EXE := $(BIN_DIR)/pbc_to_exe@exe@
#IF(darwin):
#IF(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
#IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
SOURCES := \
src/Compiler.pir \
src/Node.pir \
src/gen_grammar.pir \
src/gen_actions.pir \
src/gen_builtins.pir
BUILTINS_PIR := \
src/builtins/is_strict.pir \
src/builtins/length.pir
DOCS := README
BUILD_CLEANUPS := \
man \
markdown/markdown.pbc \
markdown.pbc \
"src/gen_*.pir" \
"*.c" \
"*$(O)" \
#IF(win32): parrot-markdown.exe \
#IF(win32): parrot-markdown.iss \
#IF(win32): "setup-parrot-*.exe" \
installable_markdown@exe@
TEST_CLEANUPS := \
t/MarkdownTest_1.0 \
"t/*.html" \
"t/*.text"
# the default target
build: markdown/markdown.pbc markdown.pbc
all: build installable
markdown/markdown.pbc: $(SOURCES)
$(PARROT) $(PARROT_ARGS) -o markdown/markdown.pbc src/Compiler.pir
markdown.pbc: markdown.pir
$(PARROT) $(PARROT_ARGS) -o markdown.pbc markdown.pir
src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg
$(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
--output=src/gen_grammar.pir \
src/parser/grammar.pg
src/gen_actions.pir: $(NQP) src/parser/actions.pm
$(PARROT) $(PARROT_ARGS) $(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
installable: installable_markdown@exe@
installable_markdown@exe@: markdown.pbc
$(PBC_TO_EXE) markdown.pbc --install
Makefile: config/makefiles/root.in
$(PERL) Configure.pl
# 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 " build: markdown.pbc"
@echo " This is the default."
@echo " all: markdown.pbc installable"
@echo " installable: Create libs and self-hosting binaries to be installed."
@echo " install: Install the installable targets and docs."
@echo ""
@echo "Testing:"
@echo " test: Run the test suite."
@echo " testclean: Clean up test results."
@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: build
$(PERL) -I$(LIB_DIR)/tools/lib t/harness
spectest: build t/MarkdownTest_1.0
$(PERL) -I$(LIB_DIR)/tools/lib t/harness
t/MarkdownTest_1.0.zip:
cd t && perl -MLWP::Simple -e "getstore(q{http:////daringfireball.net//projects//downloads//MarkdownTest_1.0.zip}, q{MarkdownTest_1.0.zip});"
t/MarkdownTest_1.0: t/MarkdownTest_1.0.zip
cd t && perl -MArchive::Zip -e "Archive::Zip->new(q{MarkdownTest_1.0.zip})->extractTree();"
codetest: codetest-c codetest-make codetest-perl codetest-pir codetest-pod
T_MAKE := config//makefiles//root.in
T_PERL := Configure.pl t//harness t//*.t t//Parrot//Test//*.pm
T_PIR := markdown.pir src//Compiler.pir src//Node.pir src//builtins//length.pir
codetest-c:
codetest-make:
- $(PROVE) @build_dir@/t/codingstd/copyright.t $(T_MAKE)
- $(PROVE) @build_dir@/t/codingstd/filenames.t $(T_MAKE)
- $(PROVE) @build_dir@/t/codingstd/make_code_coda.t $(T_MAKE)
- $(PROVE) @build_dir@/t/codingstd/linelength.t $(T_MAKE)
- $(PROVE) @build_dir@/t/codingstd/trailing_space.t $(T_MAKE)
codetest-perl:
- $(PROVE) @build_dir@/t/codingstd/copyright.t $(T_PERL)
- $(PROVE) @build_dir@/t/codingstd/cuddled_else.t $(T_PERL)
- $(PROVE) @build_dir@/t/codingstd/filenames.t $(T_PERL)
- $(PROVE) @build_dir@/t/codingstd/linelength.t $(T_PERL)
- $(PROVE) @build_dir@/t/codingstd/perlcritic.t $(T_PERL)
- $(PROVE) @build_dir@/t/codingstd/trailing_space.t $(T_PERL)
- $(PROVE) @build_dir@/t/codingstd/pod_syntax.t $(T_PERL)
codetest-pir:
- $(PROVE) @build_dir@/t/codingstd/copyright.t $(T_PIR)
- $(PROVE) @build_dir@/t/codingstd/filenames.t $(T_PIR)
- $(PROVE) @build_dir@/t/codingstd/linelength.t $(T_PIR)
- $(PROVE) @build_dir@/t/codingstd/pir_code_coda.t $(T_PIR)
- $(PROVE) @build_dir@/t/codingstd/tabs.t $(T_PIR)
- $(PROVE) @build_dir@/t/codingstd/trailing_space.t $(T_PIR)
- $(PROVE) @build_dir@/t/codingstd/pod_syntax.t $(T_PIR)
codetest-pod:
install: installable
$(CP) installable_markdown@exe@ $(BIN_DIR)/parrot-markdown@exe@
$(CHMOD) 0755 $(BIN_DIR)/parrot-markdown@exe@
-$(MKPATH) $(LIB_DIR)/languages/markdown
$(CP) markdown/markdown.pbc $(LIB_DIR)/languages/markdown/markdown.pbc
-$(MKPATH) $(MANDIR)/man1
$(POD2MAN) markdown.pir > $(MANDIR)/man1/parrot-markdown.1
-$(MKPATH) $(DOC_DIR)/languages/markdown
$(CP) $(DOCS) $(DOC_DIR)/languages/markdown
uninstall:
$(RM_F) $(BIN_DIR)/parrot-markdown@exe@
$(RM_RF) $(LIB_DIR)/languages/markdown
$(RM_F) $(MANDIR)/man1/parrot-markdown.1
$(RM_RF) $(DOC_DIR)/languages/markdown
win32-inno-installer: installable
-$(MKPATH) man/man1
$(POD2MAN) markdown.pir > man/man1/parrot-markdown.1
-$(MKPATH) man/html
pod2html --infile markdown.pir --outfile man/html/parrot-markdown.html
$(CP) installable_markdown@exe@ parrot-markdown.exe
$(PERL) -I$(LIB_DIR)/tools/lib $(LIB_DIR)/tools/dev/mk_inno_language.pl markdown
iscc parrot-markdown.iss
testclean:
$(RM_RF) $(TEST_CLEANUPS)
clean:
$(RM_RF) $(TEST_CLEANUPS) $(BUILD_CLEANUPS)
realclean:
$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS) Makefile t/MarkdownTest_1.0.zip
distclean: realclean
# Local variables:
# mode: makefile
# End:
# vim: ft=make: