-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Makefile
82 lines (63 loc) · 2.65 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
#**************************************************************************
#* *
#* OCaml *
#* *
#* Jeremie Dimino, Jane Street Europe *
#* *
#* Copyright 2016 Jane Street Group LLC *
#* *
#* All rights reserved. This file is distributed under the terms of *
#* the GNU Lesser General Public License version 2.1, with the *
#* special exception on linking described in the file LICENSE. *
#* *
#**************************************************************************
BASEDIR=..
include $(BASEDIR)/../config/Makefile
expect_MAIN=expect_test
expect_PROG=$(expect_MAIN)$(EXE)
expect_COMPFLAGS=-I $(OTOPDIR)/parsing -I $(OTOPDIR)/utils \
-I $(OTOPDIR)/driver -I $(OTOPDIR)/toplevel
expect_LIBRARIES=../../compilerlibs/ocamlcommon \
../../compilerlibs/ocamlbytecomp \
../../compilerlibs/ocamltoplevel
codegen_INCLUDES=\
-I $(OTOPDIR)/parsing \
-I $(OTOPDIR)/utils \
-I $(OTOPDIR)/typing \
-I $(OTOPDIR)/middle_end \
-I $(OTOPDIR)/bytecomp \
-I $(OTOPDIR)/asmcomp
codegen_OTHEROBJECTS=\
$(OTOPDIR)/compilerlibs/ocamlcommon.cma \
$(OTOPDIR)/compilerlibs/ocamloptcomp.cma
codegen_OBJECTS=parsecmmaux.cmo parsecmm.cmo lexcmm.cmo codegen_main.cmo
codegen_ADD_COMPFLAGS=$(codegen_INCLUDES) -w -40 -g
targets := $(expect_PROG)
ifneq "$(ARCH)" "none"
targets += codegen
ifneq "$(CCOMPTYPE)-$(ARCH)" "msvc-amd64"
# The asmgen tests are not ported to MSVC64 yet
# so do not compile any arch-specific module
targets += asmgen_$(ARCH).$(O)
endif
endif
all: $(targets)
$(expect_PROG): $(expect_LIBRARIES:=.cma) $(expect_MAIN).cmo
@$(OCAMLC) -linkall -o $@ $^
include $(BASEDIR)/makefiles/Makefile.common
.PHONY: clean
clean: defaultclean
rm -f $(expect_PROG)
rm -f codegen parsecmm.ml parsecmm.mli lexcmm.ml
expect_test.cmo: COMPFLAGS=$(expect_COMPFLAGS)
$(codegen_OBJECTS): ADD_COMPFLAGS = $(codegen_ADD_COMPFLAGS)
codegen_main.cmo: parsecmm.cmo
codegen: $(codegen_OBJECTS)
@$(OCAMLC) $(LINKFLAGS) -o $@ $(codegen_OTHEROBJECTS) $^
parsecmm.mli parsecmm.ml: parsecmm.mly
@$(OCAMLYACC) -q parsecmm.mly
lexcmm.ml: lexcmm.mll
@$(OCAMLLEX) -q lexcmm.mll
asmgen_i386.obj: asmgen_i386nt.asm
@set -o pipefail ; \
$(ASM) $@ $^ | tail -n +2