-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathOMakeCFLAGS
33 lines (30 loc) · 1.27 KB
/
OMakeCFLAGS
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
open configure/Configure
CheckCFlag(flag) =
CFLAGS += $(flag)
program = $'int main(void) { return 0; }'
return $(TryCompileC $(program))
static. =
section
DEVCFLAGS=$(EMPTY)
Add_flags(flags)=
CC=$(OCAMLC_CC)
CFLAGS= $(OCAMLC_CC_CFLAGS) $(CFLAGS)
foreach(f, $(flags))
if $(CheckCFlag $(DEVCFLAGS) $(f))
export
DEVCFLAGS+= $(f)
export
export
if $(not $(or $(equal $(getenv DEBUG_MY_CODE, $(EMPTY)), $(EMPTY)), $(or $(equal $(OCAMLC_SYSTEM),win32), $(equal $(OCAMLC_SYSTEM),win64))))
Add_flags(-Wall -Wextra -O2 -g -Waggregate-return -Wbad-function-cast -Wdate-time -Wendif-labels -Werror=overflow -Wfloat-equal -Wformat=2 -Wformat-security -Wformat-nonliteral -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wundef -Wuninitialized -Wunused -Wunused-macros -Wwrite-strings)
CC=$(OCAMLC_CC)
CFLAGS= $(OCAMLC_CC_CFLAGS) $(CFLAGS)
if $(CheckCFlag $(DEVCFLAGS) -std=gnu11)
DEVCFLAGS+= -std=gnu11
export
elseif $(CheckCFlag $(DEVCFLAGS) -std=gnu99)
DEVCFLAGS+= -std=gnu99
export
export DEVCFLAGS
export DEVCFLAGS
#DEVCFLAGS+=-DNDEBUG=1