ocamltest: Makefile improvements

- Use := everywhere
- Merge two ifeq blocks
master
Sébastien Hinderer 2018-03-14 13:15:27 +01:00
parent 94fbfe2e79
commit c715d93da5
1 changed files with 9 additions and 13 deletions

View File

@ -21,9 +21,15 @@ ifeq "$(UNIX_OR_WIN32)" "win32"
unix := false
ocamlsrcdir := $(shell echo "$(abspath $(shell pwd)/..)"|cygpath -w -f - \
| sed 's/\\/\\\\\\\\/g')
ifeq "$(wildcard ../flexdll/Makefile)" ""
FLEXLINK_ENV=
else
FLEXLINK_ENV=OCAML_FLEXLINK="../boot/ocamlrun ../flexdll/flexlink.exe"
endif
else
unix := true
ocamlsrcdir := $(abspath $(shell pwd)/..)
FLEXLINK_ENV=
endif
ifeq "$(TOOLCHAIN)" "msvc"
@ -119,24 +125,14 @@ bytecode_modules := $(o_files) $(cmo_files)
native_modules := $(o_files) $(cmx_files)
directories = ../utils ../parsing ../stdlib ../compilerlibs
directories := ../utils ../parsing ../stdlib ../compilerlibs
include_directories = $(addprefix -I , $(directories))
include_directories := $(addprefix -I , $(directories))
flags = -g -nostdlib $(include_directories) \
flags := -g -nostdlib $(include_directories) \
-strict-sequence -safe-string -strict-formats \
-w +a-4-9-41-42-44-45-48 -warn-error A
ifeq "$(UNIX_OR_WIN32)" "unix"
FLEXLINK_ENV=
else # Windows
ifeq "$(wildcard ../flexdll/Makefile)" ""
FLEXLINK_ENV=
else
FLEXLINK_ENV=OCAML_FLEXLINK="../boot/ocamlrun ../flexdll/flexlink.exe"
endif
endif
ocamlc := $(FLEXLINK_ENV) ../byterun/ocamlrun ../ocamlc $(flags)
ocamlopt := $(FLEXLINK_ENV) ../byterun/ocamlrun ../ocamlopt $(flags)