aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/ocaml
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-12-03 21:15:53 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-12-03 21:15:53 +0000
commitf3608a0b8d5a6162f70a248adaf4f0b81dd1b33d (patch)
tree7591674d53df41a96b566c028c9fa5fcd03c1894 /bindings/ocaml
parente286f6de30a3eb321c1d8d4ac2e933b94f33bfdc (diff)
downloadexternal_llvm-f3608a0b8d5a6162f70a248adaf4f0b81dd1b33d.zip
external_llvm-f3608a0b8d5a6162f70a248adaf4f0b81dd1b33d.tar.gz
external_llvm-f3608a0b8d5a6162f70a248adaf4f0b81dd1b33d.tar.bz2
Track dependencies when creating symlinks to LLVM libraries next
to the ocaml bindings. This is required on Windows where 'ln -sf' actually creates a copy. Thanks to Alain Frisch for noticing this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/ocaml')
-rw-r--r--bindings/ocaml/Makefile.ocaml35
1 files changed, 26 insertions, 9 deletions
diff --git a/bindings/ocaml/Makefile.ocaml b/bindings/ocaml/Makefile.ocaml
index fa03c63..b7f4fde 100644
--- a/bindings/ocaml/Makefile.ocaml
+++ b/bindings/ocaml/Makefile.ocaml
@@ -70,11 +70,13 @@ OutputCMA := $(LibraryCMA:$(ObjDir)/%.cma=$(OcamlDir)/%.cma)
OutputCMXA := $(LibraryCMXA:$(ObjDir)/%.cmxa=$(OcamlDir)/%.cmxa)
OutputsCMI := $(ObjectsCMI:$(ObjDir)/%.cmi=$(OcamlDir)/%.cmi)
OutputsCMX := $(ObjectsCMX:$(ObjDir)/%.cmx=$(OcamlDir)/%.cmx)
+OutputLibs := $(UsedLibNames:%=$(OcamlDir)/%)
# Installation targets
DestA := $(PROJ_libocamldir)/lib$(LIBRARYNAME).a
DestCMA := $(PROJ_libocamldir)/$(LIBRARYNAME).cma
DestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
+DestLibs := $(UsedLibNames:%=$(PROJ_libocamldir)/%)
##===- Dependencies -------------------------------------------------------===##
@@ -123,6 +125,30 @@ uninstall-a::
-$(Verb) $(RM) -f $(DestA)
+##===- Deposit dependent libraries adjacent to Ocaml libs -----------------===##
+
+all-local:: build-deplibs
+clean-local:: clean-deplibs
+install-local:: install-deplibs
+uninstall-local:: uninstall-deplibs
+
+build-deplibs: $(OutputLibs)
+
+$(OcamlDir)/%.a: $(LibDir)/%.a
+ $(Verb) ln -sf $< $@
+
+clean-deplibs:
+ $(Verb) rm -f $(OutputLibs)
+
+install-deplibs:
+ $(Verb) for i in $(DestLibs:$(PROJ_libocamldir)/%=%); do \
+ ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
+ done
+
+uninstall-deplibs:
+ $(Verb) rm -f $(DestLibs)
+
+
##===- Build ocaml interfaces (.mli's -> .cmi's) --------------------------===##
all-local:: build-cmis
@@ -178,9 +204,6 @@ $(OutputCMA): $(LibraryCMA) $(OcamlDir)/.dir
$(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
$(Verb) $(Archive.CMA) $@ $(ObjectsCMO)
- $(Verb) for i in $(UsedLibNames); do \
- ln -sf "$(LibDir)/$$i" "$(OcamlDir)/$$i"; \
- done
$(ObjDir)/%.cmo: $(ObjDir)/%.ml
$(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
@@ -193,16 +216,10 @@ install-cma:: $(OutputCMA)
$(Echo) "Installing $(BuildMode) $(DestCMA)"
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Verb) $(DataInstall) $(OutputCMA) "$(DestCMA)"
- $(Verb) for i in $(UsedLibNames); do \
- ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
- done
uninstall-cma::
$(Echo) "Uninstalling $(DestCMA)"
-$(Verb) $(RM) -f $(DestCMA)
- $(Verb) for i in $(UsedLibNames); do \
- $(RM) -f "$(PROJ_libocamldir)/$$i"; \
- done
##===- Build optimized ocaml archive (.ml's -> .cmx's -> .cmxa, .a) -------===##