2010-04-20 08:38:58 -07:00
|
|
|
#########################################################################
|
|
|
|
# #
|
2011-07-27 07:17:02 -07:00
|
|
|
# OCaml #
|
2010-04-20 08:38:58 -07:00
|
|
|
# #
|
|
|
|
# Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt #
|
|
|
|
# #
|
|
|
|
# Copyright 2007 Institut National de Recherche en Informatique et #
|
|
|
|
# en Automatique. All rights reserved. This file is distributed #
|
|
|
|
# under the terms of the Q Public License version 1.0. #
|
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
2007-02-07 00:59:16 -08:00
|
|
|
.PHONY: all byte native profile debug ppcache doc
|
|
|
|
|
|
|
|
ifndef INSTALL_PREFIX
|
2007-10-08 07:19:34 -07:00
|
|
|
INSTALL_PREFIX := $(PWD)/_install
|
2007-02-07 00:59:16 -08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef INSTALL_LIB
|
|
|
|
INSTALL_LIB := $(INSTALL_PREFIX)/lib/ocamlbuild
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef INSTALL_BIN
|
|
|
|
INSTALL_BIN := $(INSTALL_PREFIX)/bin
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef BUILDDIR
|
|
|
|
BUILDDIR := "_build"
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef OCAMLBUILDCMD
|
|
|
|
OCAMLBUILDCMD := ./boot/ocamlbuild
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef O
|
|
|
|
OCAMLBUILD_OPTIONS := $(OCAMLBUILD_OPTIONS) $(O)
|
|
|
|
endif
|
|
|
|
|
2009-03-05 06:33:06 -08:00
|
|
|
ifeq ($(wildcard ./ocamlbuild_Myocamlbuil*_config.ml),./ocamlbuild_Myocamlbuild_config.ml)
|
2007-02-07 00:59:16 -08:00
|
|
|
ifeq ($(wildcard ./boot/oc*build),./boot/ocamlbuild)
|
2007-10-08 07:19:34 -07:00
|
|
|
OCAMLBUILD=INSTALL_LIB=$(INSTALL_LIB) INSTALL_BIN=$(INSTALL_BIN) $(OCAMLBUILDCMD) -build-dir $(BUILDDIR) -no-links $(OCAMLBUILD_OPTIONS)
|
2007-02-07 00:59:16 -08:00
|
|
|
LIBS=ocamlbuildlib ocamlbuildlightlib
|
|
|
|
PROGRAMS=ocamlbuild ocamlbuildlight
|
|
|
|
BYTE=$(LIBS:=.cma) $(PROGRAMS:=.byte)
|
|
|
|
NATIVE=$(LIBS:=.cmxa) $(PROGRAMS:=.native)
|
|
|
|
|
|
|
|
all:
|
|
|
|
$(OCAMLBUILD) $(BYTE) $(NATIVE)
|
|
|
|
byte:
|
|
|
|
$(OCAMLBUILD) $(BYTE)
|
2009-03-05 06:33:06 -08:00
|
|
|
native:
|
|
|
|
$(OCAMLBUILD) $(NATIVE)
|
2007-02-07 00:59:16 -08:00
|
|
|
profile:
|
|
|
|
$(OCAMLBUILD) $(LIBS:=.p.cmxa) $(PROGRAMS:=.p.native)
|
|
|
|
debug:
|
|
|
|
$(OCAMLBUILD) $(LIBS:=.d.cma) $(PROGRAMS:=.d.byte)
|
|
|
|
ppcache:
|
|
|
|
$(OCAMLBUILD) ppcache.byte ppcache.native
|
|
|
|
doc:
|
|
|
|
$(OCAMLBUILD) ocamlbuild.docdir/index.html
|
2008-10-08 06:09:39 -07:00
|
|
|
ln -s -f $(BUILDDIR)/ocamlbuild.docdir doc
|
2007-02-07 00:59:16 -08:00
|
|
|
else
|
|
|
|
all byte native: ocamlbuild.byte.start
|
2007-10-08 07:19:34 -07:00
|
|
|
mkdir -p boot
|
2007-02-07 00:59:16 -08:00
|
|
|
cp ocamlbuild.byte.start boot/ocamlbuild
|
|
|
|
$(MAKE) $(MFLAGS) $(MAKECMDGOALS)
|
|
|
|
cp $(BUILDDIR)/ocamlbuild.native boot/ocamlbuild
|
2007-02-07 07:18:17 -08:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKECMDGOALS) OCAMLBUILD_OPTIONS="-nothing-should-be-rebuilt -verbose -1"
|
2007-02-07 00:59:16 -08:00
|
|
|
endif
|
2009-03-05 06:33:06 -08:00
|
|
|
else
|
|
|
|
all byte native:
|
|
|
|
@echo "Please copy the myocamlbuild_config.ml of the OCaml source distribution"
|
|
|
|
@echo " as ocamlbuild_Myocamlbuild_config.ml"
|
|
|
|
@echo
|
|
|
|
@echo "$$ cp ../myocamlbuild_config.ml ocamlbuild_Myocamlbuild_config.ml"
|
|
|
|
endif
|
2007-02-07 00:59:16 -08:00
|
|
|
|
|
|
|
ocamlbuild.byte.start:
|
|
|
|
./start.sh
|
|
|
|
|
|
|
|
promote:
|
|
|
|
cp $(BUILDDIR)/ocamlbuild.native boot/ocamlbuild
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(BUILDDIR)
|
|
|
|
|
|
|
|
distclean: clean
|
2007-02-09 05:29:12 -08:00
|
|
|
rm -rf _log _start ocamlbuild.byte.start boot/ocamlbuild
|
2007-02-07 00:59:16 -08:00
|
|
|
|
|
|
|
install: all
|
|
|
|
mkdir -p $(INSTALL_BIN)
|
|
|
|
mkdir -p $(INSTALL_LIB)
|
|
|
|
install $(BUILDDIR)/ocamlbuild.byte \
|
|
|
|
$(BUILDDIR)/ocamlbuild.native \
|
|
|
|
$(BUILDDIR)/ocamlbuildlight.byte \
|
|
|
|
$(BUILDDIR)/ocamlbuildlight.native \
|
|
|
|
$(INSTALL_BIN)
|
|
|
|
install $(BUILDDIR)/ocamlbuild.native $(INSTALL_BIN)/ocamlbuild
|
|
|
|
install $(BUILDDIR)/ocamlbuildlight.byte $(INSTALL_BIN)/ocamlbuildlight
|
|
|
|
install -m 644 \
|
|
|
|
$(BUILDDIR)/ocamlbuildlib.cmxa \
|
|
|
|
$(BUILDDIR)/ocamlbuildlib.a \
|
|
|
|
$(BUILDDIR)/ocamlbuildlib.cma \
|
|
|
|
$(BUILDDIR)/ocamlbuildlightlib.cmxa \
|
|
|
|
$(BUILDDIR)/ocamlbuildlightlib.a \
|
|
|
|
$(BUILDDIR)/ocamlbuildlightlib.cma \
|
2007-11-22 10:34:22 -08:00
|
|
|
$(BUILDDIR)/ocamlbuild_unix_plugin.cmx \
|
|
|
|
$(BUILDDIR)/ocamlbuild_unix_plugin.o \
|
|
|
|
$(BUILDDIR)/ocamlbuild_unix_plugin.cmo \
|
|
|
|
$(BUILDDIR)/ocamlbuild_unix_plugin.cmi \
|
|
|
|
$(BUILDDIR)/ocamlbuild_executor.cmi \
|
|
|
|
$(BUILDDIR)/ocamlbuild_executor.cmo \
|
|
|
|
$(BUILDDIR)/ocamlbuild_executor.cmx \
|
|
|
|
$(BUILDDIR)/ocamlbuild_executor.o \
|
2007-02-07 00:59:16 -08:00
|
|
|
$(BUILDDIR)/ocamlbuild_pack.cmi \
|
2007-11-22 10:34:22 -08:00
|
|
|
$(BUILDDIR)/ocamlbuild_pack.cmo \
|
2007-02-07 00:59:16 -08:00
|
|
|
$(BUILDDIR)/ocamlbuild_pack.cmx \
|
2007-11-22 10:34:22 -08:00
|
|
|
$(BUILDDIR)/ocamlbuild_pack.o \
|
2007-02-07 00:59:16 -08:00
|
|
|
$(BUILDDIR)/ocamlbuild.cmi \
|
|
|
|
$(BUILDDIR)/ocamlbuild_plugin.cmi \
|
|
|
|
$(BUILDDIR)/ocamlbuild.cmx \
|
|
|
|
$(BUILDDIR)/ocamlbuild.o \
|
|
|
|
$(BUILDDIR)/ocamlbuild.cmo \
|
|
|
|
$(BUILDDIR)/ocamlbuildlight.cmx \
|
|
|
|
$(BUILDDIR)/ocamlbuildlight.o \
|
|
|
|
$(BUILDDIR)/ocamlbuildlight.cmo $(INSTALL_LIB)
|
|
|
|
ranlib $(INSTALL_LIB)/ocamlbuildlib.a
|
|
|
|
ranlib $(INSTALL_LIB)/ocamlbuildlightlib.a
|