/
Makefile.in
188 lines (154 loc) · 5.05 KB
/
Makefile.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
## $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
LOAD_EXT := @load_ext@
O := @o@
# Various paths
PERL6GRAMMAR := $(LIB_DIR)/library/PGE/Perl6Grammar.pbc
NQP := $(LIB_DIR)/languages/nqp/nqp.pbc
PCT := $(LIB_DIR)/library/PCT.pbc
PMC_DIR := src/pmc
OPS_DIR := src/ops
## Setup some commands
MAKE := @make_c@
PERL := @perl@
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@
NQPTAP_GROUP := $(PMC_DIR)/nqptap_group$(LOAD_EXT)
NQPTAP_OPS := $(OPS_DIR)/nqptap_ops$(LOAD_EXT)
#PMC_DEPS := src/pmc/Makefile.in $(PMC_DIR)/nqptap.pmc
#OPS_DEPS := src/ops/Makefile.in $(OPS_DIR)/nqptap.ops
SOURCES := \
src/nqptap.pir \
src/gen_grammar.pir \
src/gen_actions.pir \
src/builtins.pir \
src/builtins/say.pir
DOCS := README
BUILD_CLEANUPS := \
nqptap.pbc \
nqptap/nqptap.pbc \
"src/gen_*.pir" \
"*.c" \
"*$(O)" \
#IF(win32): parrot-nqptap.exe \
#IF(win32): parrot-nqptap.iss \
#IF(win32): "setup-parrot-*.exe" \
installable_nqptap@exe@
TEST_CLEANUPS :=
# the default target
build: \
$(NQPTAP_OPS) \
$(NQPTAP_GROUP) \
nqptap/nqptap.pbc \
nqptap.pbc
all: build installable
nqptap.pbc: nqptap.pir
$(PARROT) $(PARROT_ARGS) -o nqptap.pbc nqptap.pir
nqptap/nqptap.pbc: $(SOURCES)
$(PARROT) $(PARROT_ARGS) -o nqptap/nqptap.pbc src/nqptap.pir
src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg src/parser/grammar-oper.pg
$(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
--output=src/gen_grammar.pir \
src/parser/grammar.pg \
src/parser/grammar-oper.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
$(NQPTAP_GROUP): $(PMC_DEPS)
# $(MAKE) $(PMC_DIR)
$(NQPTAP_OPS): $(OPS_DEPS)
# $(MAKE) $(OPS_DIR)
installable: installable_nqptap@exe@
installable_nqptap@exe@: nqptap.pbc
$(PBC_TO_EXE) nqptap.pbc --install
Makefile: Makefile.in
$(PARROT) Configure.pir
# 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: nqptap.pbc"
@echo " This is the default."
@echo " nqptap@exe@ Self-hosting binary not to be installed."
@echo " all: nqptap.pbc nqptap@exe@ 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 " test-installable: Test self-hosting targets."
@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
prove --exec="$(PARROT) nqptap.pbc" t/*.t
# basic run for missing libs
test-installable: installable
echo "1" | ./installable_nqptap@exe@
install: installable
# $(MAKE) $(OPS_DIR) install
# $(MAKE) $(PMC_DIR) install
$(CP) installable_nqptap@exe@ $(BIN_DIR)/parrot-nqptap@exe@
$(CHMOD) 0755 $(BIN_DIR)/parrot-nqptap@exe@
-$(MKPATH) $(LIB_DIR)/languages/nqptap
$(CP) nqptap/nqptap.pbc $(LIB_DIR)/languages/nqptap/nqptap.pbc
# -$(MKPATH) $(MANDIR)/man1
# $(POD2MAN) doc/running.pod > $(MANDIR)/man1/parrot-nqptap.1
# -$(MKPATH) $(DOC_DIR)/languages/nqptap
# $(CP) $(DOCS) $(DOC_DIR)/languages/nqptap
uninstall:
# $(MAKE) $(OPS_DIR) uninstall
# $(MAKE) $(PMC_DIR) uninstall
$(RM_F) $(BIN_DIR)/parrot-nqptap@exe@
$(RM_RF) $(LIB_DIR)/languages/nqptap
# $(RM_F) $(MANDIR)/man1/parrot-nqptap.1
# $(RM_RF) $(DOC_DIR)/languages/nqptap
win32-inno-installer: installable
# -$(MKPATH) man/man1
# $(POD2MAN) doc/running.pod > man/man1/parrot-nqptap.1
# -$(MKPATH) man/html
# pod2html --infile doc/running.pod --outfile man/html/parrot-nqptap.html
$(CP) installable_nqptap@exe@ parrot-nqptap.exe
$(PERL) -I$(LIB_DIR)/tools/lib $(LIB_DIR)/tools/dev/mk_inno_language.pl nqptap
iscc parrot-nqptap.iss
testclean:
$(RM_F) $(TEST_CLEANUPS)
clean:
# $(MAKE) $(OPS_DIR) clean
# $(MAKE) $(PMC_DIR) clean
$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS)
realclean:
# $(MAKE) $(OPS_DIR) realclean
# $(MAKE) $(PMC_DIR) realclean
$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS) Makefile
distclean: realclean
# Local variables:
# mode: makefile
# End:
# vim: ft=make: