-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile.common
49 lines (42 loc) · 1.14 KB
/
Makefile.common
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
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
OCAMLMKLIB=ocamlmklib
OCAMLFIND=ocamlfind
OCAMLRUN=ocamlrun
STDLIBDIR:=$(shell $(OCAMLC) -where)
VERSION=$(shell sed -ne 's/^ *version *: *"\([^"]*\)".*$$/\1/p' ../num.opam)
INSTALL_DATA=install -m 644
INSTALL_DLL=install
INSTALL_DIR=install -d
include $(STDLIBDIR)/Makefile.config
ifeq "$(NATIVE_COMPILER)" ""
# $(NATIVE_COMPILER) was added in 4.09: use $(ARCH) for 4.06-4.08
ifeq "$(ARCH)" "none"
NATIVE_COMPILER = false
else
NATIVE_COMPILER = true
endif
endif
# PROFILE=dev or PROFILE=release
PROFILE ?= auto
# Assume we're in release mode if there's no .git directory (means that an old
# school installation from a tarball assumes release mode, but a Git clone
# assumes development mode)
ifeq "$(PROFILE)" "auto"
# This file is included from a sub-directory, hence the ../
ifeq "$(wildcard ../.git)" ""
PROFILE = release
else
PROFILE = dev
endif
endif
ifneq "$(filter-out release dev, $(PROFILE))$(word 2, $(PROFILE))" ""
$(error The PROFILE variable must be one of auto, dev, or release)
endif
# Only use -warn-error in dev mode
ifeq "$(PROFILE)" "dev"
WARN_ERROR = -warn-error +A
else
WARN_ERROR =
endif