10908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen##===- tools/ml/Makefile -----------------------------------*- Makefile -*-===##
20908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# 
30908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen#                     The LLVM Compiler Infrastructure
40908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen#
557360d1f1cede3b26744d0ce3ade814fcc0f332dChris Lattner# This file is distributed under the University of Illinois Open Source
657360d1f1cede3b26744d0ce3ade814fcc0f332dChris Lattner# License. See LICENSE.TXT for details.
70908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# 
80908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen##===----------------------------------------------------------------------===##
90908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# 
100908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# An ocaml library is a unique project type in the context of LLVM, so rules are
110908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# here rather than in Makefile.rules.
120908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# 
13c0491ac8b6c24a7d0db8c0a60f76cfb1d66f84abGordon Henriksen# Reference materials on installing ocaml libraries:
14c0491ac8b6c24a7d0db8c0a60f76cfb1d66f84abGordon Henriksen# 
15c0491ac8b6c24a7d0db8c0a60f76cfb1d66f84abGordon Henriksen#   https://fedoraproject.org/wiki/Packaging/OCaml
16c0491ac8b6c24a7d0db8c0a60f76cfb1d66f84abGordon Henriksen#   http://pkg-ocaml-maint.alioth.debian.org/ocaml_packaging_policy.txt
17c0491ac8b6c24a7d0db8c0a60f76cfb1d66f84abGordon Henriksen# 
180908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen##===----------------------------------------------------------------------===##
190908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
200908d49c22775d20a88f595845b515f669d528f7Gordon Henrikseninclude $(LEVEL)/Makefile.config
210908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
223b802476d24a6b8c7d1e645f99b4c25ef6e97809Gordon Henriksen# CFLAGS needs to be set before Makefile.rules is included.
239e7aba2739fb3edb3ddcf04c5d36c7c1cccb0581Gordon HenriksenCXX.Flags += -I"$(shell $(OCAMLC) -where)"
249e7aba2739fb3edb3ddcf04c5d36c7c1cccb0581Gordon HenriksenC.Flags += -I"$(shell $(OCAMLC) -where)"
250908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
260908d49c22775d20a88f595845b515f669d528f7Gordon Henrikseninclude $(LEVEL)/Makefile.common
270908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
280908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# Intentionally ignore PROJ_prefix here. We want the ocaml stdlib. However, the
291d4e0782ba9761e3c664de53b837b74c0c818ff1Gordon Henriksen# user can override this with OCAML_LIBDIR or configure --with-ocaml-libdir=.
300908d49c22775d20a88f595845b515f669d528f7Gordon HenriksenPROJ_libocamldir := $(DESTDIR)$(OCAML_LIBDIR)
310908d49c22775d20a88f595845b515f669d528f7Gordon HenriksenOcamlDir := $(LibDir)/ocaml
320908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
330908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# Info from llvm-config and similar
34ae77a201488fc439bfdfa6314b947a1f5457b701Bob Wilsonifndef IS_CLEANING_TARGET
350908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenifdef UsedComponents
360908d49c22775d20a88f595845b515f669d528f7Gordon HenriksenUsedLibs = $(shell $(LLVM_CONFIG) --libs $(UsedComponents))
370908d49c22775d20a88f595845b515f669d528f7Gordon HenriksenUsedLibNames = $(shell $(LLVM_CONFIG) --libnames $(UsedComponents))
380908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenendif
39ae77a201488fc439bfdfa6314b947a1f5457b701Bob Wilsonendif
400908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
410908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# Tools
4246c95bbe0616fc37cb56866a57939487f45eca00Bob WilsonOCAMLCFLAGS += -I $(ObjDir) -I $(OcamlDir)
43ae77a201488fc439bfdfa6314b947a1f5457b701Bob Wilsonifndef IS_CLEANING_TARGET
44f368dadd9425de65fea4283daef5d197e98cc1cdGordon Henriksenifneq ($(ObjectsO),)
450908d49c22775d20a88f595845b515f669d528f7Gordon HenriksenOCAMLAFLAGS += $(patsubst %,-cclib %, \
46ed29a28464d1b19d3e043a4cf1e95eedca745842Gordon Henriksen                 $(filter-out -L$(LibDir),-l$(LIBRARYNAME) \
47ed29a28464d1b19d3e043a4cf1e95eedca745842Gordon Henriksen                                          $(shell $(LLVM_CONFIG) --ldflags)) \
48ed29a28464d1b19d3e043a4cf1e95eedca745842Gordon Henriksen                                          $(UsedLibs))
49f368dadd9425de65fea4283daef5d197e98cc1cdGordon Henriksenelse
50f368dadd9425de65fea4283daef5d197e98cc1cdGordon HenriksenOCAMLAFLAGS += $(patsubst %,-cclib %, \
51f368dadd9425de65fea4283daef5d197e98cc1cdGordon Henriksen                 $(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --ldflags)) \
52f368dadd9425de65fea4283daef5d197e98cc1cdGordon Henriksen                                          $(UsedLibs))
53f368dadd9425de65fea4283daef5d197e98cc1cdGordon Henriksenendif
54ae77a201488fc439bfdfa6314b947a1f5457b701Bob Wilsonendif
552e855e68d861224c9b61e2bc9cecad1536b1534bGordon Henriksen 
564e20a09b6fcf616f1a7bbe0dba4b5fa133b8a5e5Gordon Henriksen# -g was introduced in 3.10.0.
574e20a09b6fcf616f1a7bbe0dba4b5fa133b8a5e5Gordon Henriksen#ifneq ($(ENABLE_OPTIMIZED),1)
584e20a09b6fcf616f1a7bbe0dba4b5fa133b8a5e5Gordon Henriksen#  OCAMLDEBUGFLAG := -g
594e20a09b6fcf616f1a7bbe0dba4b5fa133b8a5e5Gordon Henriksen#endif
600908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
612e855e68d861224c9b61e2bc9cecad1536b1534bGordon HenriksenCompile.CMI  := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
622e855e68d861224c9b61e2bc9cecad1536b1534bGordon HenriksenCompile.CMO  := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
632e855e68d861224c9b61e2bc9cecad1536b1534bGordon HenriksenArchive.CMA  := $(strip $(OCAMLC) -a -custom $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) \
642e855e68d861224c9b61e2bc9cecad1536b1534bGordon Henriksen                                  -o)
650908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
662e855e68d861224c9b61e2bc9cecad1536b1534bGordon HenriksenCompile.CMX  := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
672e855e68d861224c9b61e2bc9cecad1536b1534bGordon HenriksenArchive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) -o)
680908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
6949457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef OCAMLOPT
7049457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarArchive.EXE := $(strip $(OCAMLOPT) -cc $(CXX) $(OCAMLCFLAGS) $(UsedOcamLibs:%=%.cmxa) $(OCAMLDEBUGFLAG) -o)
7149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarelse
7249457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarArchive.EXE := $(strip $(OCAMLC) -cc $(CXX) $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG:%=%.cma) -o)
7349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
7449457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
750908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# Source files
7601b4ccb6f7f59373c397274b82b3d65701336c03Erick Tryzelaarifndef OcamlSources1
77a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon HenriksenOcamlSources1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml))
7801b4ccb6f7f59373c397274b82b3d65701336c03Erick Tryzelaarendif
7901b4ccb6f7f59373c397274b82b3d65701336c03Erick Tryzelaar
8001b4ccb6f7f59373c397274b82b3d65701336c03Erick Tryzelaarifndef OcamlHeaders1
8149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarOcamlHeaders1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.mli))
8201b4ccb6f7f59373c397274b82b3d65701336c03Erick Tryzelaarendif
8349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
8449457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarOcamlSources2 := $(filter-out $(ExcludeSources),$(OcamlSources1))
8549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarOcamlHeaders2 := $(filter-out $(ExcludeHeaders),$(OcamlHeaders1))
86a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
8749457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarOcamlSources := $(OcamlSources2:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
8849457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarOcamlHeaders := $(OcamlHeaders2:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
89a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
90a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen# Intermediate files
91a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon HenriksenObjectsCMI   := $(OcamlSources:%.ml=%.cmi)
92a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon HenriksenObjectsCMO   := $(OcamlSources:%.ml=%.cmo)
93a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon HenriksenObjectsCMX   := $(OcamlSources:%.ml=%.cmx)
94a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
9549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef LIBRARYNAME
9649457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarLibraryCMA   := $(ObjDir)/$(LIBRARYNAME).cma
9749457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarLibraryCMXA  := $(ObjDir)/$(LIBRARYNAME).cmxa
9849457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
9949457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
10049457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef TOOLNAME
10149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarToolEXE      := $(ObjDir)/$(TOOLNAME)$(EXEEXT)
10249457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
10349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
104a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen# Output files
105a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen#   The .cmo files are the only intermediates; all others are to be installed.
106a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon HenriksenOutputsCMI := $(ObjectsCMI:$(ObjDir)/%.cmi=$(OcamlDir)/%.cmi)
107a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon HenriksenOutputsCMX := $(ObjectsCMX:$(ObjDir)/%.cmx=$(OcamlDir)/%.cmx)
108516276edd4adadf8d521ae6ba29713dacc353c0aGordon HenriksenOutputLibs := $(UsedLibNames:%=$(OcamlDir)/%)
1090908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
11049457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef LIBRARYNAME
11149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarLibraryA   := $(OcamlDir)/lib$(LIBRARYNAME).a
11249457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarOutputCMA  := $(LibraryCMA:$(ObjDir)/%.cma=$(OcamlDir)/%.cma)
11349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarOutputCMXA := $(LibraryCMXA:$(ObjDir)/%.cmxa=$(OcamlDir)/%.cmxa)
11449457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
11549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
11649457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef TOOLNAME
11749457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef EXAMPLE_TOOL
11849457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarOutputEXE := $(ExmplDir)/$(strip $(TOOLNAME))$(EXEEXT)
11949457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarelse
12049457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarOutputEXE := $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT)
12149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
12249457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
12349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
1240908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# Installation targets
12549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick TryzelaarDestLibs := $(UsedLibNames:%=$(PROJ_libocamldir)/%)
12649457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
12749457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef LIBRARYNAME
1280908d49c22775d20a88f595845b515f669d528f7Gordon HenriksenDestA    := $(PROJ_libocamldir)/lib$(LIBRARYNAME).a
1290908d49c22775d20a88f595845b515f669d528f7Gordon HenriksenDestCMA  := $(PROJ_libocamldir)/$(LIBRARYNAME).cma
1300908d49c22775d20a88f595845b515f669d528f7Gordon HenriksenDestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
13149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
1320908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
133a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen##===- Dependencies -------------------------------------------------------===##
134a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen# Copy the sources into the intermediate directory because older ocamlc doesn't
135a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen# support -o except when linking (outputs are placed next to inputs).
136a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
137a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen$(ObjDir)/%.mli: $(PROJ_SRC_DIR)/%.mli $(ObjDir)/.dir
138a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(CP) -f $< $@
139a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
140a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen$(ObjDir)/%.ml: $(PROJ_SRC_DIR)/%.ml $(ObjDir)/.dir
141a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(CP) -f $< $@
142a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
14349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar$(ObjectsCMI): $(UsedOcamlInterfaces:%=$(OcamlDir)/%.cmi)
14449457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
14549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef LIBRARYNAME
146ab4456f10a72f3a7c73dac0e95578b9b7e4250b8Gordon Henriksen$(ObjDir)/$(LIBRARYNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \
147ab4456f10a72f3a7c73dac0e95578b9b7e4250b8Gordon Henriksen                                   $(OcamlDir)/.dir $(ObjDir)/.dir
148e6074a027fd78939cc69a8c5db72f789b4e1b2c7Gordon Henriksen	$(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
149a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
150a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen-include $(ObjDir)/$(LIBRARYNAME).ocamldep
15149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
15249457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
15349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef TOOLNAME
15449457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar$(ObjDir)/$(TOOLNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \
15549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar                                $(OcamlDir)/.dir $(ObjDir)/.dir
15649457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
157a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
15849457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar-include $(ObjDir)/$(TOOLNAME).ocamldep
15949457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
160a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
1610908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen##===- Build static library from C sources --------------------------------===##
1620908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
16349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef LibraryA
1640908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenall-local:: $(LibraryA)
1650908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenclean-local:: clean-a
1660908d49c22775d20a88f595845b515f669d528f7Gordon Henrikseninstall-local:: install-a
1670908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenuninstall-local:: uninstall-a
1680908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
1690908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen$(LibraryA): $(ObjectsO) $(OcamlDir)/.dir
1700908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Building $(BuildMode) $(notdir $@)"
1710908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	-$(Verb) $(RM) -f $@
1720908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(Archive) $@ $(ObjectsO)
1730908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(Ranlib) $@
1740908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
1750908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenclean-a::
1760908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	-$(Verb) $(RM) -f $(LibraryA)
1770908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
1780908d49c22775d20a88f595845b515f669d528f7Gordon Henrikseninstall-a:: $(LibraryA)
1790908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Installing $(BuildMode) $(DestA)"
1800908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(MKDIR) $(PROJ_libocamldir)
181a15dc035a6d4153bece7a067e037e5d6f5d58b16Nick Lewycky	$(Verb) $(INSTALL) $(LibraryA) $(DestA)
1820908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) 
1830908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
1840908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenuninstall-a::
1850908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Uninstalling $(DestA)"
1860908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	-$(Verb) $(RM) -f $(DestA)
187f368dadd9425de65fea4283daef5d197e98cc1cdGordon Henriksenendif
1880908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
1890908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
190516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen##===- Deposit dependent libraries adjacent to Ocaml libs -----------------===##
191516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen
192516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksenall-local:: build-deplibs
193516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksenclean-local:: clean-deplibs
194516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henrikseninstall-local:: install-deplibs
195516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksenuninstall-local:: uninstall-deplibs
196516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen
197516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksenbuild-deplibs: $(OutputLibs)
198516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen
199516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen$(OcamlDir)/%.a: $(LibDir)/%.a
200516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen	$(Verb) ln -sf $< $@
201516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen
2022e855e68d861224c9b61e2bc9cecad1536b1534bGordon Henriksen$(OcamlDir)/%.o: $(LibDir)/%.o
2032e855e68d861224c9b61e2bc9cecad1536b1534bGordon Henriksen	$(Verb) ln -sf $< $@
2042e855e68d861224c9b61e2bc9cecad1536b1534bGordon Henriksen
205516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksenclean-deplibs:
20649457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Verb) $(RM) -f $(OutputLibs)
207516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen
208516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henrikseninstall-deplibs:
2093994b4b05e02736c98744647d1d495e77c844413Bob Wilson	$(Verb) $(MKDIR) $(PROJ_libocamldir)
210516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen	$(Verb) for i in $(DestLibs:$(PROJ_libocamldir)/%=%); do \
211516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen	  ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
212516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen	done
213516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen
214516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksenuninstall-deplibs:
21549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Verb) $(RM) -f $(DestLibs)
216516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen
217516276edd4adadf8d521ae6ba29713dacc353c0aGordon Henriksen
2180908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen##===- Build ocaml interfaces (.mli's -> .cmi's) --------------------------===##
2190908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
22049457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifneq ($(OcamlHeaders),)
2210908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenall-local:: build-cmis
2220908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenclean-local:: clean-cmis
2230908d49c22775d20a88f595845b515f669d528f7Gordon Henrikseninstall-local:: install-cmis
2240908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenuninstall-local:: uninstall-cmis
2250908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
226a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksenbuild-cmis: $(OutputsCMI)
227a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
228a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen$(OcamlDir)/%.cmi: $(ObjDir)/%.cmi $(OcamlDir)/.dir
229a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(CP) -f $< $@
2300908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
231a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen$(ObjDir)/%.cmi: $(ObjDir)/%.mli $(ObjDir)/.dir
2320908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
2330908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(Compile.CMI) $@ $<
2340908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
2350908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenclean-cmis::
236a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	-$(Verb) $(RM) -f $(OutputsCMI)
2370908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
2380908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# Also install the .mli's (headers) as documentation.
239a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henrikseninstall-cmis: $(OutputsCMI) $(OcamlHeaders)
2400908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(MKDIR) $(PROJ_libocamldir)
241a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) for i in $(OcamlHeaders:$(ObjDir)/%=%); do \
2420908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	  $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
243a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	  $(DataInstall) $(ObjDir)/$$i "$(PROJ_libocamldir)/$$i"; \
2440908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	done
245f5b8ce151008ceecc83bc897e10c51f2ca271e9dWojciech Matyjewicz	$(Verb) for i in $(OutputsCMI:$(OcamlDir)/%=%); do \
246f5b8ce151008ceecc83bc897e10c51f2ca271e9dWojciech Matyjewicz	  $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
247f5b8ce151008ceecc83bc897e10c51f2ca271e9dWojciech Matyjewicz	  $(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
248f5b8ce151008ceecc83bc897e10c51f2ca271e9dWojciech Matyjewicz	done
2490908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
2500908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenuninstall-cmis::
251a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) for i in $(OutputsCMI:$(OcamlDir)/%=%); do \
2520908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	  $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
2530908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	  $(RM) -f "$(PROJ_libocamldir)/$$i"; \
2540908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	done
255a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) for i in $(OcamlHeaders:$(ObjDir)/%=%); do \
2560908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	  $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
2570908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	  $(RM) -f "$(PROJ_libocamldir)/$$i"; \
2580908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	done
25949457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
2600908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
2610908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
2620908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen##===- Build ocaml bytecode archive (.ml's -> .cmo's -> .cma) -------------===##
2630908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
26449457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar$(ObjDir)/%.cmo: $(ObjDir)/%.ml
26549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
26649457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Verb) $(Compile.CMO) $@ $<
26749457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
26849457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef LIBRARYNAME
269a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksenall-local:: $(OutputCMA)
2700908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenclean-local:: clean-cma
2710908d49c22775d20a88f595845b515f669d528f7Gordon Henrikseninstall-local:: install-cma
2720908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenuninstall-local:: uninstall-cma
2730908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
274a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen$(OutputCMA): $(LibraryCMA) $(OcamlDir)/.dir
275a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(CP) -f $< $@
276a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
2770908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen$(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
2780908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
2790908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(Archive.CMA) $@ $(ObjectsCMO)
2800908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
2810908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenclean-cma::
282a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(RM) -f $(OutputCMA) $(UsedLibNames:%=$(OcamlDir)/%)
2830908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
284a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henrikseninstall-cma:: $(OutputCMA)
2850908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Installing $(BuildMode) $(DestCMA)"
2860908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(MKDIR) $(PROJ_libocamldir)
287a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(DataInstall) $(OutputCMA) "$(DestCMA)"
2880908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
2890908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenuninstall-cma::
2900908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Uninstalling $(DestCMA)"
2910908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	-$(Verb) $(RM) -f $(DestCMA)
29249457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
2930908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
2940908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen##===- Build optimized ocaml archive (.ml's -> .cmx's -> .cmxa, .a) -------===##
2950908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
2960908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# The ocamlopt compiler is supported on a set of targets disjoint from LLVM's.
2970908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen# If unavailable, 'configure' will not define OCAMLOPT in Makefile.config.
2980908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenifdef OCAMLOPT
2990908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
30049457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar$(OcamlDir)/%.cmx: $(ObjDir)/%.cmx
30149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Verb) $(CP) -f $< $@
30249457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
30349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar$(ObjDir)/%.cmx: $(ObjDir)/%.ml
30449457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Echo) "Compiling optimized $(notdir $<) for $(BuildMode) build"
30549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Verb) $(Compile.CMX) $@ $<
30649457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
30749457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef LIBRARYNAME
308a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksenall-local:: $(OutputCMXA) $(OutputsCMX)
3090908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenclean-local:: clean-cmxa
3100908d49c22775d20a88f595845b515f669d528f7Gordon Henrikseninstall-local:: install-cmxa
3110908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenuninstall-local:: uninstall-cmxa
3120908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
313a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen$(OutputCMXA): $(LibraryCMXA)
314a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(CP) -f $< $@
315a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(CP) -f $(<:.cmxa=.a) $(@:.cmxa=.a)
316a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen
3170908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen$(LibraryCMXA): $(ObjectsCMX)
3180908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
3190908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(Archive.CMXA) $@ $(ObjectsCMX)
3200908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(RM) -f $(@:.cmxa=.o)
3210908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
3220908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenclean-cmxa::
3234b169cd1ebf96d8ed71505a1e1bde3764747361aGordon Henriksen	$(Verb) $(RM) -f $(OutputCMXA) $(OutputCMXA:.cmxa=.a) $(OutputsCMX)
3240908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
325a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henrikseninstall-cmxa:: $(OutputCMXA) $(OutputsCMX)
3260908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(MKDIR) $(PROJ_libocamldir)
3270908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Installing $(BuildMode) $(DestCMXA)"
328a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(DataInstall) $(OutputCMXA) $(DestCMXA)
3290908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Installing $(BuildMode) $(DestCMXA:.cmxa=.a)"
330a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) $(DataInstall) $(OutputCMXA:.cmxa=.a) $(DestCMXA:.cmxa=.a)
331a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) for i in $(OutputsCMX:$(OcamlDir)/%=%); do \
3320908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	  $(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
3330908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	  $(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
3340908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	done
3350908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
336a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksenuninstall-cmxa::
3370908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Uninstalling $(DestCMXA)"
3380908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(RM) -f $(DestCMXA)
3390908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Uninstalling $(DestCMXA:.cmxa=.a)"
3400908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Verb) $(RM) -f $(DestCMXA:.cmxa=.a)
341a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Verb) for i in $(OutputsCMX:$(OcamlDir)/%=%); do \
3420908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	  $(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
3430908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	  $(RM) -f $(PROJ_libocamldir)/$$i; \
3440908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	done
34549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
34649457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
34749457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
34849457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar##===- Build executables --------------------------------------------------===##
34949457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
35049457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifdef TOOLNAME
35149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarall-local:: $(OutputEXE)
35249457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarclean-local:: clean-exe
35349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar
35449457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar$(OutputEXE): $(ToolEXE) $(OcamlDir)/.dir
35549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Verb) $(CP) -f $< $@
3560908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
35749457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarifndef OCAMLOPT
35849457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar$(ToolEXE): $(ObjectsCMO) $(OcamlDir)/.dir
35949457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
36001b4ccb6f7f59373c397274b82b3d65701336c03Erick Tryzelaar	$(Verb) $(Archive.EXE) $@ $(ObjectsCMO)
36149457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarelse
36249457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar$(ToolEXE): $(ObjectsCMX) $(OcamlDir)/.dir
36349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
36401b4ccb6f7f59373c397274b82b3d65701336c03Erick Tryzelaar	$(Verb) $(Archive.EXE) $@ $(ObjectsCMX)
36549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaarendif
3660908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenendif
3670908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
368b04776696359e54153e20c426419fe54b6766473Gordon Henriksen##===- Generate documentation ---------------------------------------------===##
369b04776696359e54153e20c426419fe54b6766473Gordon Henriksen
370b04776696359e54153e20c426419fe54b6766473Gordon Henriksen$(ObjDir)/$(LIBRARYNAME).odoc: $(ObjectsCMI)
371b04776696359e54153e20c426419fe54b6766473Gordon Henriksen	$(Echo) "Documenting $(notdir $@)"
37246c95bbe0616fc37cb56866a57939487f45eca00Bob Wilson	$(Verb) $(OCAMLDOC) -I $(ObjDir) -I $(OcamlDir) -dump $@ $(OcamlHeaders)
373b04776696359e54153e20c426419fe54b6766473Gordon Henriksen
374b04776696359e54153e20c426419fe54b6766473Gordon Henriksenocamldoc: $(ObjDir)/$(LIBRARYNAME).odoc
3750908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
3760908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen##===- Debugging gunk -----------------------------------------------------===##
3770908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenprintvars:: printcamlvars
3780908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
3790908d49c22775d20a88f595845b515f669d528f7Gordon Henriksenprintcamlvars::
3800908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "LLVM_CONFIG  : " '$(LLVM_CONFIG)'
3810908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "OCAMLCFLAGS  : " '$(OCAMLCFLAGS)'
3820908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "OCAMLAFLAGS  : " '$(OCAMLAFLAGS)'
3830908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "OCAMLC       : " '$(OCAMLC)'
3840908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "OCAMLOPT     : " '$(OCAMLOPT)'
385a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Echo) "OCAMLDEP     : " '$(OCAMLDEP)'
3860908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Compile.CMI  : " '$(Compile.CMI)'
3870908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Compile.CMO  : " '$(Compile.CMO)'
3880908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Archive.CMA  : " '$(Archive.CMA)'
3890908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Compile.CMX  : " '$(Compile.CMX)'
3900908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "Archive.CMXA : " '$(Archive.CMXA)'
3910908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "CAML_LIBDIR  : " '$(CAML_LIBDIR)'
3920908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "LibraryCMA   : " '$(LibraryCMA)'
3930908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "LibraryCMXA  : " '$(LibraryCMXA)'
394a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Echo) "OcamlSources1: " '$(OcamlSources1)'
39549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Echo) "OcamlSources2: " '$(OcamlSources2)'
3960908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "OcamlSources : " '$(OcamlSources)'
39749457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Echo) "OcamlHeaders1: " '$(OcamlHeaders1)'
39849457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar	$(Echo) "OcamlHeaders2: " '$(OcamlHeaders2)'
399a8c3660c1a4be5d4887f1899bc3c8e62b875c6c0Gordon Henriksen	$(Echo) "OcamlHeaders : " '$(OcamlHeaders)'
4000908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "ObjectsCMI   : " '$(ObjectsCMI)'
4010908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "ObjectsCMO   : " '$(ObjectsCMO)'
4020908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "ObjectsCMX   : " '$(ObjectsCMX)'
4030908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "OCAML_LIBDIR : " '$(OCAML_LIBDIR)'
4040908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "DestA        : " '$(DestA)'
4050908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "DestCMA      : " '$(DestCMA)'
4060908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "DestCMXA     : " '$(DestCMXA)'
4070908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "UsedLibs     : " '$(UsedLibs)'
4080908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen	$(Echo) "UsedLibNames : " '$(UsedLibNames)'
4090908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen
4100908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen.PHONY: printcamlvars   build-cmis \
4110908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen            clean-a     clean-cmis     clean-cma     clean-cmxa \
4120908d49c22775d20a88f595845b515f669d528f7Gordon Henriksen          install-a   install-cmis   install-cma   install-cmxa \
41349457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar          install-exe \
41449457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar		uninstall-a uninstall-cmis uninstall-cma uninstall-cmxa \
41549457b81589c6a3ef384caa8fdf1463ad2ada7c7Erick Tryzelaar		uninstall-exe
416