File: Makefile

package info (click to toggle)
ocaml 4.11.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 34,304 kB
  • sloc: ml: 290,481; ansic: 45,162; sh: 19,565; asm: 3,783; makefile: 3,618; awk: 254; perl: 45; fortran: 21; cs: 9
file content (100 lines) | stat: -rw-r--r-- 2,904 bytes parent folder | download
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
#**************************************************************************
#*                                                                        *
#*                                 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.          *
#*                                                                        *
#**************************************************************************

.NOTPARALLEL:

TOPDIR = ../..

COMPILERLIBSDIR = $(TOPDIR)/compilerlibs

RUNTIME_VARIANT ?=
ASPPFLAGS ?=

include $(TOPDIR)/Makefile.tools

expect_MAIN=expect_test
expect_PROG=$(expect_MAIN)$(EXE)
expect_DIRS = parsing utils driver typing toplevel
expect_OCAMLFLAGS = $(addprefix -I $(TOPDIR)/,$(expect_DIRS))
expect_LIBS := $(addprefix $(COMPILERLIBSDIR)/,\
  ocamlcommon ocamlbytecomp ocamltoplevel)

codegen_PROG = codegen$(EXE)
codegen_DIRS = parsing utils typing middle_end bytecomp lambda asmcomp
codegen_OCAMLFLAGS = $(addprefix -I $(TOPDIR)/, $(codegen_DIRS)) -w +40 -g

codegen_LIBS = $(addprefix $(COMPILERLIBSDIR)/,\
  ocamlcommon ocamloptcomp)

codegen_OBJECTS = $(addsuffix .cmo,\
  parsecmmaux parsecmm lexcmm codegen_main)

tools := $(expect_PROG)

ifeq "$(NATIVE_COMPILER)" "true"
tools += $(codegen_PROG)
ifneq "$(CCOMPTYPE)-$(ARCH)" "msvc-amd64"
# The asmgen tests are not ported to MSVC64 yet
# so do not compile any arch-specific module
tools += asmgen_$(ARCH).$(O)
endif
endif

all: $(tools)

$(expect_PROG): $(expect_LIBS:=.cma) $(expect_MAIN).cmo
	$(OCAMLC) -linkall -o $@ $^

$(expect_PROG): COMPFLAGS = $(expect_OCAMLFLAGS)

$(codegen_PROG): COMPFLAGS = $(codegen_OCAMLFLAGS)

codegen_main.cmo: parsecmm.cmo

$(codegen_PROG): $(codegen_OBJECTS)
	$(OCAMLC) -o $@ $(codegen_LIBS:=.cma) $^

parsecmm.mli parsecmm.ml: parsecmm.mly
	$(OCAMLYACC) -q parsecmm.mly

lexcmm.ml: lexcmm.mll
	$(OCAMLLEX) -q lexcmm.mll

parsecmmaux.cmo: parsecmmaux.cmi

lexcmm.cmo: lexcmm.cmi

parsecmm.cmo: parsecmm.cmi

asmgen_i386.obj: asmgen_i386nt.asm
	@set -o pipefail ; \
	$(ASM) $@ $^ | tail -n +2

%.cmi: %.mli
	$(OCAMLC) -c $<

%.cmo: %.ml
	$(OCAMLC) -c $<

%.cmx: %.ml
	$(OCAMLOPT) -c $<

%.$(O): %.S
	$(ASPP) $(ASPPFLAGS) -DSYS_$(SYSTEM) -DMODEL_$(MODEL) -o $@ $<

.PHONY: clean
clean:
	rm -f *.cm* *.o *.obj
	rm -f expect_test expect_test.exe codegen codegen.exe
	rm -f parsecmm.ml parsecmm.mli lexcmm.ml