-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
122 lines (90 loc) · 3.84 KB
/
Makefile
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
# Makefile,v
# Copyright (c) INRIA 2007-2017
TOP=.
include $(TOP)/config/Makefile
WD=$(shell pwd)
DESTDIR=
RM=rm
SYSDIRS= util-lib testutils runtime runtime_fat base pa_unmatched_vala \
pa_dock pa_here pa_here_original pa_undo_deriving pa_assert \
pa_inline_test pa_expect_test pa_hashrecons \
pa_deriving pa_deriving.plugins pa_import \
protobuf_runtime
TESTDIRS= tests-ounit2 our-tests-inline tests-deriving-protobuf \
tests-inline tests-expect
PACKAGES := pa_ppx_utils
PACKAGES := $(PACKAGES),pa_ppx_base
PACKAGES := $(PACKAGES),pa_ppx_unmatched_vala
PACKAGES := $(PACKAGES),pa_ppx_here
PACKAGES := $(PACKAGES),pa_ppx_assert
PACKAGES := $(PACKAGES),pa_ppx_inline_test
PACKAGES := $(PACKAGES),pa_ppx_expect_test
PACKAGES := $(PACKAGES),pa_ppx_deriving
PACKAGES := $(PACKAGES),pa_ppx_deriving_plugins.std
PACKAGES := $(PACKAGES),pa_ppx_deriving_plugins.yojson
PACKAGES := $(PACKAGES),pa_ppx_hashrecons
PACKAGES := $(PACKAGES),pa_ppx_import
BATCHTOP = camlp5o.pa_ppx camlp5o.pa_ppx.opt \
camlp5r.pa_ppx camlp5r.pa_ppx.opt
setup: get-generated
all: sys
set -e; for i in $(TESTDIRS); do cd $$i; $(MAKE) all; cd ..; done
sys: plugins $(BATCHTOP)
$(BATCHTOP): plugins
plugins: prereqs
set -e; for i in $(SYSDIRS); do cd $$i; $(MAKE) all; cd ..; done
doc: all
set -e; for i in $(SYSDIRS); do cd $$i; $(MAKE) doc; cd ..; done
rm -rf docs
tools/make-docs pa_ppx docs
make -C doc html
test: all
set -e; for i in $(TESTDIRS); do cd $$i; $(MAKE) test; cd ..; done
prereqs:
(perl -MIPC::System::Simple -e 1 > /dev/null 2>&1) || (echo "MUST install Perl module IPC::System::Simple" && exit -1)
(perl -MString::ShellQuote -e 1 > /dev/null 2>&1) || (echo "MUST install Perl module String::ShellQuote" && exit -1)
bootstrap:
$(MAKE) -C runtime bootstrap-exn bootstrap-exn-i
$(MAKE) -C runtime_fat bootstrap-exn bootstrap-exn-i
$(MAKE) -C base bootstrap-pp-MLast bootstrap-pp-MLast-i bootstrap-pp-parsetree bootstrap-pp-parsetree-i
initialize:
$(MAKE) -C runtime initialize-exn initialize-exn-i
$(MAKE) -C runtime_fat initialize-exn initialize-exn-i
$(MAKE) -C base initialize-pp-MLast initialize-pp-MLast-i initialize-pp-parsetree initialize-pp-parsetree-i
ocamlGENERATED=base/pp_parsetree.ml base/pp_parsetree.mli \
runtime/exceptions.ml runtime/exceptions.mli \
runtime_fat/exceptions.ml runtime_fat/exceptions.mli
camlp5GENERATED=base/pp_MLast.ml base/pp_MLast.mli
ocamlVERSION=$(shell ocamlc --version)
camlp5VERSION=$(shell camlp5 -version)
genocamlVERSION=$(shell config/find_gensrc.pl ocaml 4. $(ocamlVERSION))
gencamlp5VERSION=$(shell config/find_gensrc.pl camlp5 8. $(camlp5VERSION))
save-generated:
mkdir -p generated_src/$(ocamlVERSION)
tar -cf - $(ocamlGENERATED) | tar -C generated_src/$(ocamlVERSION) -xvBf -
mkdir -p generated_src/$(camlp5VERSION)
tar -cf - $(camlp5GENERATED) | tar -C generated_src/$(camlp5VERSION) -xvBf -
get-generated: generated_src/$(genocamlVERSION) generated_src/$(gencamlp5VERSION)
tar -C generated_src/$(genocamlVERSION) -cf - . | tar -xvBf -
tar -C generated_src/$(gencamlp5VERSION) -cf - . | tar -xvBf -
camlp5r.pa_ppx:
tools/LAUNCH $(MKCAMLP5) -verbose -package camlp5.pa_r,camlp5.pr_r,$(PACKAGES) -o $@
camlp5r.pa_ppx.opt:
tools/LAUNCH $(MKCAMLP5).opt -verbose -package camlp5.pa_r,camlp5.pr_r,$(PACKAGES) -o $@
camlp5o.pa_ppx:
tools/LAUNCH $(MKCAMLP5) -verbose -package camlp5.pa_o,camlp5.pr_o,$(PACKAGES) -o $@
camlp5o.pa_ppx.opt:
tools/LAUNCH $(MKCAMLP5).opt -verbose -package camlp5.pa_o,camlp5.pr_o,$(PACKAGES) -o $@
META: META.pl
./META.pl > META
install: sys META.pl
$(OCAMLFIND) remove pa_ppx || true
./META.pl > META
$(OCAMLFIND) install pa_ppx META local-install/lib/*/*.*
uninstall:
$(OCAMLFIND) remove pa_ppx || true
clean::
set -e; for i in $(SYSDIRS) $(TESTDIRS); do cd $$i; $(MAKE) clean; cd ..; done
rm -rf docs local-install
depend:
set -e; for i in $(SYSDIRS) $(TESTDIRS); do cd $$i; $(MAKE) depend; cd ..; done