1999-11-17 10:59:06 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
2011-07-27 07:17:02 -07:00
|
|
|
# OCaml #
|
1999-11-17 10:59:06 -08:00
|
|
|
# #
|
|
|
|
# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
|
|
|
|
# #
|
|
|
|
# Copyright 1999 Institut National de Recherche en Informatique et #
|
|
|
|
# en Automatique. All rights reserved. This file is distributed #
|
2001-12-07 05:41:02 -08:00
|
|
|
# under the terms of the GNU Library General Public License, with #
|
|
|
|
# the special exception on linking described in file ../LICENSE. #
|
1999-11-17 10:59:06 -08:00
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
# Configuration for Windows, Mingw compiler
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
######### General configuration
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
PREFIX=C:/ocamlmgw
|
2000-01-31 21:43:25 -08:00
|
|
|
|
2012-04-04 05:56:49 -07:00
|
|
|
### Remove this to disable compiling camlp4
|
2013-07-28 08:52:14 -07:00
|
|
|
WITH_CAMLP4=camlp4
|
|
|
|
|
|
|
|
### Remove this to disable compiling ocamldebug
|
|
|
|
WITH_DEBUGGER=ocamldebugger
|
2012-04-04 05:56:49 -07:00
|
|
|
|
2013-07-28 08:52:17 -07:00
|
|
|
### Remove this to disable compiling ocamlbuild; camlp4 requires ocamlbuild
|
|
|
|
WITH_OCAMLBUILD=ocamlbuild
|
|
|
|
|
|
|
|
### Remove this to disable compiling ocamldoc
|
|
|
|
WITH_OCAMLDOC=ocamldoc
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
### Where to install the binaries
|
2002-06-07 02:49:45 -07:00
|
|
|
BINDIR=$(PREFIX)/bin
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
### Where to install the standard library
|
2002-06-07 02:49:45 -07:00
|
|
|
LIBDIR=$(PREFIX)/lib
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-27 04:36:02 -07:00
|
|
|
### Where to install the stub DLLs
|
|
|
|
STUBLIBDIR=$(LIBDIR)/stublibs
|
|
|
|
|
1996-03-11 05:58:31 -08:00
|
|
|
### Where to install the info files
|
2000-01-31 21:43:25 -08:00
|
|
|
DISTRIB=$(PREFIX)
|
1996-03-11 05:58:31 -08:00
|
|
|
|
2007-02-23 06:03:30 -08:00
|
|
|
### Where to install the man pages
|
|
|
|
MANDIR=$(PREFIX)/man
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
########## Toolchain and OS dependencies
|
|
|
|
|
|
|
|
TOOLCHAIN=mingw
|
2011-12-12 03:38:06 -08:00
|
|
|
|
|
|
|
### Toolchain prefix
|
2013-07-01 12:28:15 -07:00
|
|
|
TARGET=i686-w64-mingw32
|
|
|
|
HOST=i686-w64-mingw32
|
|
|
|
|
|
|
|
TOOLPREF=$(TARGET)-
|
2011-12-12 03:38:06 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
CCOMPTYPE=cc
|
|
|
|
O=o
|
|
|
|
A=a
|
|
|
|
S=s
|
|
|
|
SO=s.o
|
|
|
|
EXE=.exe
|
2007-02-07 02:31:36 -08:00
|
|
|
EXT_DLL=.dll
|
|
|
|
EXT_OBJ=.$(O)
|
|
|
|
EXT_LIB=.$(A)
|
|
|
|
EXT_ASM=.$(S)
|
|
|
|
MANEXT=1
|
|
|
|
SHARPBANGSCRIPTS=false
|
|
|
|
PTHREAD_LINK=
|
|
|
|
X11_INCLUDES=
|
|
|
|
X11_LINK=
|
|
|
|
BYTECCRPATH=
|
|
|
|
SUPPORTS_SHARED_LIBRARIES=true
|
|
|
|
SHAREDCCCOMPOPTS=
|
|
|
|
MKSHAREDLIBRPATH=
|
|
|
|
NATIVECCPROFOPTS=
|
|
|
|
NATIVECCRPATH=
|
2011-12-12 03:38:06 -08:00
|
|
|
ASM=$(TOOLPREF)as
|
2013-04-30 03:02:34 -07:00
|
|
|
ASPP=$(TOOLPREF)gcc -c
|
2007-02-07 02:31:36 -08:00
|
|
|
ASPPPROFFLAGS=
|
|
|
|
PROFILING=noprof
|
|
|
|
DYNLINKOPTS=
|
|
|
|
CC_PROFILE=
|
|
|
|
SYSTHREAD_SUPPORT=true
|
|
|
|
EXTRALIBS=
|
2010-05-25 03:00:39 -07:00
|
|
|
NATDYNLINK=true
|
2007-11-06 07:16:56 -08:00
|
|
|
CMXS=cmxs
|
2011-12-16 09:02:48 -08:00
|
|
|
RUNTIMED=noruntimed
|
2012-04-04 06:03:21 -07:00
|
|
|
ASM_CFI_SUPPORTED=false
|
1999-10-14 06:35:59 -07:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
########## Configuration for the bytecode compiler
|
|
|
|
|
|
|
|
### Which C compiler to use for the bytecode interpreter.
|
2011-12-12 03:38:06 -08:00
|
|
|
BYTECC=$(TOOLPREF)gcc
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
### Additional compile-time options for $(BYTECC). (For static linking.)
|
2003-01-06 06:57:01 -08:00
|
|
|
BYTECCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
### Additional link-time options for $(BYTECC). (For static linking.)
|
2002-06-07 02:49:45 -07:00
|
|
|
BYTECCLINKOPTS=
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
### Additional compile-time options for $(BYTECC). (For building a DLL.)
|
2003-07-08 08:12:58 -07:00
|
|
|
DLLCCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused -DCAML_DLL
|
2001-08-28 07:47:48 -07:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
### Libraries needed
|
2008-07-29 01:31:41 -07:00
|
|
|
BYTECCLIBS=-lws2_32
|
|
|
|
NATIVECCLIBS=-lws2_32
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
### How to invoke the C preprocessor
|
2002-06-18 06:01:53 -07:00
|
|
|
CPP=$(BYTECC) -E
|
2002-06-07 02:49:45 -07:00
|
|
|
|
2007-11-15 05:21:15 -08:00
|
|
|
### Flexlink
|
2012-03-23 08:14:02 -07:00
|
|
|
FLEXLINK=flexlink -chain mingw -stack 16777216
|
2007-11-15 05:21:15 -08:00
|
|
|
FLEXDIR=$(shell $(FLEXLINK) -where)
|
|
|
|
IFLEXDIR=-I"$(FLEXDIR)"
|
|
|
|
MKDLL=$(FLEXLINK)
|
|
|
|
MKEXE=$(FLEXLINK) -exe
|
2007-11-15 07:18:28 -08:00
|
|
|
MKMAINDLL=$(FLEXLINK) -maindll
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
### How to build a static library
|
2011-12-12 03:38:06 -08:00
|
|
|
MKLIB=rm -f $(1); $(TOOLPREF)ar rc $(1) $(2); $(RANLIB) $(1)
|
|
|
|
#ml let mklib out files opts = Printf.sprintf "rm -f %s && %sar rcs %s %s %s" out toolpref opts out files;;
|
2002-06-07 02:49:45 -07:00
|
|
|
|
|
|
|
### Canonicalize the name of a system library
|
|
|
|
SYSLIB=-l$(1)
|
2007-02-07 02:31:36 -08:00
|
|
|
#ml let syslib x = "-l"^x;;
|
2002-06-07 02:49:45 -07:00
|
|
|
|
|
|
|
### The ranlib command
|
2011-12-12 03:38:06 -08:00
|
|
|
RANLIB=$(TOOLPREF)ranlib
|
|
|
|
RANLIBCMD=$(TOOLPREF)ranlib
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-01-16 01:05:37 -08:00
|
|
|
### The ar command
|
|
|
|
ARCMD=$(TOOLPREF)ar
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
############# Configuration for the native-code compiler
|
|
|
|
|
|
|
|
### Name of architecture for the native-code compiler
|
|
|
|
ARCH=i386
|
|
|
|
|
|
|
|
### Name of architecture model for the native-code compiler.
|
|
|
|
MODEL=default
|
|
|
|
|
|
|
|
### Name of operating system family for the native-code compiler.
|
2002-06-07 02:49:45 -07:00
|
|
|
SYSTEM=mingw
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
### Which C compiler to use for the native-code compiler.
|
2002-06-18 06:01:53 -07:00
|
|
|
NATIVECC=$(BYTECC)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
### Additional compile-time options for $(NATIVECC).
|
2003-01-06 06:57:01 -08:00
|
|
|
NATIVECCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
### Additional link-time options for $(NATIVECC)
|
2002-06-07 02:49:45 -07:00
|
|
|
NATIVECCLINKOPTS=
|
|
|
|
|
|
|
|
### Build partially-linked object file
|
2013-03-09 14:38:52 -08:00
|
|
|
PACKLD=$(TOOLPREF)ld -r $(NATIVECCLINKOPTS) -o # must have a space after '-o'
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
############# Configuration for the contributed libraries
|
|
|
|
|
2013-09-09 02:32:00 -07:00
|
|
|
OTHERLIBRARIES=win32unix str num win32graph dynlink bigarray systhreads
|
1996-04-01 07:25:05 -08:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
### Name of the target architecture for the "num" library
|
2004-04-01 05:08:56 -08:00
|
|
|
BNG_ARCH=ia32
|
|
|
|
BNG_ASM_LEVEL=1
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
############# Aliases for common commands
|
|
|
|
|
2010-01-22 04:48:24 -08:00
|
|
|
MAKEREC=$(MAKE) -f Makefile.nt
|
2002-06-07 02:49:45 -07:00
|
|
|
MAKECMD=$(MAKE)
|
2013-04-29 11:21:50 -07:00
|
|
|
|
|
|
|
############# for the testsuite makefiles
|
2013-05-07 02:40:18 -07:00
|
|
|
#ml let topdir = "" and wintopdir = "";;
|
|
|
|
OTOPDIR=$(WINTOPDIR)
|
|
|
|
CTOPDIR=$(TOPDIR)
|
2013-04-29 11:21:50 -07:00
|
|
|
CYGPATH=cygpath -m
|
|
|
|
DIFF=diff -q --strip-trailing-cr
|
|
|
|
CANKILL=false
|
2013-05-17 05:03:58 -07:00
|
|
|
SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
|
2013-09-19 17:22:38 -07:00
|
|
|
|
|
|
|
THIS_MAKEFILE=$(filter %config/Makefile,$(MAKEFILE_LIST))
|
|
|
|
ifeq ($(filter /%,$(THIS_MAKEFILE)),)
|
|
|
|
ROOTDIR:=$(abspath $(dir $(CURDIR)/$(THIS_MAKEFILE))/..)
|
|
|
|
else
|
|
|
|
ROOTDIR:=$(abspath $(dir $(THIS_MAKEFILE))/..)
|
|
|
|
endif
|
|
|
|
CAMLRUN:=$(ROOTDIR)/boot/ocamlrun$(EXE)
|
|
|
|
OCAMLRUN:=$(CAMLRUN)
|
|
|
|
ROOTDIR_COMPAT:=$(shell $(CYGPATH) $(ROOTDIR))
|
|
|
|
CAMLC_BIN_BOOT = $(CAMLRUN) $(ROOTDIR_COMPAT)/boot/ocamlc
|
|
|
|
CAMLC_BIN_BYTE = $(CAMLRUN) $(ROOTDIR_COMPAT)/ocamlc
|
|
|
|
CAMLC_BIN_OPT = $(ROOTDIR_COMPAT)/ocamlc.opt
|
|
|
|
CAMLOPT_BIN_BYTE = $(CAMLRUN) $(ROOTDIR_COMPAT)/ocamlopt
|
|
|
|
CAMLOPT_BIN_OPT = $(ROOTDIR_COMPAT)/ocamlopt.opt
|
|
|
|
|
|
|
|
CAMLC_BIN = @ . $(ROOTDIR)/config/ocamlcomp; PS4=""; set -x; $${CAMLC_BIN}
|
|
|
|
CAMLOPT_BIN = @ . $(ROOTDIR)/config/ocamlcomp; PS4=""; set -x; $${CAMLOPT_BIN}
|
|
|
|
CAMLC_BIN_CMD_TO_EVAL = . $(ROOTDIR)/config/ocamlcomp; echo $${CAMLC_BIN}
|
|
|
|
CAMLOPT_BIN_CMD_TO_EVAL = . $(ROOTDIR)/config/ocamlcomp; echo $${CAMLOPT_BIN}
|