Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (47 sloc) 1.95 KB
# Where binaries are installed:
BINDIR := `dirname \`which ocamlc\``
####
LIBRARY := js_of_ocaml
LIBNAME := js_of_ocaml$(LIBEXT)
COMPILER := js_of_ocaml$(EXEEXT)
MINIFIER := jsoo_minify$(EXEEXT)
MKTOP := jsoo_mktop$(EXEEXT)
MKCMIS := jsoo_mkcmis$(EXEEXT)
PPX := ppx_js$(EXEXT)
# opt/byte
BEST := opt
DOCOPT := -colorize-code -short-functors -charset utf-8
####
EXEEXT :=
OBJEXT := .o
LIBEXT := .a
DLLEXT := .so
ifeq ($(shell ocamlc -config | grep -q "architecture: i386"; echo $$?),0)
ARCH_32BIT=YES
endif
ifeq ($(shell ocamlc -safe-string 2> /dev/null ; echo $$?),0)
SAFESTRING=-safe-string
else
SAFESTRING=-package bytes
endif
### Optional dependencies: deriving
WITH_DERIVING ?= $(shell if [ -f `ocamlfind query deriving 2> /dev/null`/deriving.cma ]; then echo YES; else echo NO; fi)
WITH_GRAPHICS ?= $(shell if [ -f `ocamlfind query graphics 2> /dev/null`/graphics.cmi ]; then echo YES; else echo NO; fi)
WITH_REACT ?= $(shell if [ -f `ocamlfind query reactiveData 2> /dev/null`/reactiveData.cma ]; then echo YES; else echo NO; fi)
WITH_TYXML ?= $(shell if [ -f `ocamlfind query tyxml 2> /dev/null`/tyxml_f.cma ]; then echo YES; else echo NO; fi)
WITH_ASYNC ?= $(shell if [ -f `ocamlfind query async_kernel 2> /dev/null`/async_kernel.cma ]; then echo YES; else echo NO; fi)
WITH_FINDLIB?=YES
NATDYNLINK ?= $(shell if [ -f `ocamlc -where`/dynlink.cmxa ]; then echo YES; else echo NO; fi)
WITH_PPX_TOOLS ?= $(shell if [ -f `ocamlfind query ppx_tools 2> /dev/null`/ppx_tools.cma ]; then echo YES; else echo NO; fi)
WITH_PPX_DERIVING ?= $(shell if [ -f `ocamlfind query ppx_deriving 2> /dev/null`/ppx_deriving.cma ]; then echo YES; else echo NO; fi)
##disabled for ocaml < 4.02.2
ifeq "${WITH_PPX_TOOLS}" "YES"
ifneq ($(shell ocamlc -version | grep -q -E "4.02.[01]"; echo $$?),0)
WITH_PPX ?= YES
WITH_TOPLEVEL=YES
endif
endif
METAOCAML ?= 0
VERSION_GIT := $(shell git log -n1 --pretty=format:%h 2> /dev/null)
%.ml: %.cppo.ml
cppo $< -o $@ -V OCAML:`ocamlc -version`
Something went wrong with that request. Please try again.