X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/60771194f4808507a435db7c201e3e75675986be..f4b893045495fe7868d595f2663adb3808dbac2c:/interpretor/lib/Makefile

diff --git a/interpretor/lib/Makefile b/interpretor/lib/Makefile
index e249b40..d6ed16f 100644
--- a/interpretor/lib/Makefile
+++ b/interpretor/lib/Makefile
@@ -1,40 +1,35 @@
-LIBSNDFILESRC := src/libsndfile-1.0.25
-prefix := libsndfile
-rootdir := $(abspath .)
-#TARGETDIR ?= ""
-#PREFIX ?= /usr/local
-#prefix := $(DESTDIR)$(PREFIX)
-#arch   := $(wildcard architecture/*.*)
+# Faustine library dependancies Makefile.
+
+LIBSNDFILE_SRCDIR ?= src/libsndfile-1.0.25
+LIBSFOCAML_SRCDIR ?= src/libsndfile-ocaml
+LIBSNDFILE_DESTNAME ?= libsndfile
+DESTDIR := $(abspath .)/$(LIBSNDFILE_DESTNAME)
 
 all: librairies
 
-librairies :: libsndfile
-#	@cp $(SNDFILE_PATH)/sndfile_stub.o $(SRC_DIR)
-#	@cd $(SRC_DIR) && $(MAKE) opt OCAML_INCLUDE_PATH=$(OCAML_INCLUDE_PATH) SNDFILE_PATH=$(SNDFILE_PATH)
-#	@cd $(SRC_DIR) && $(MAKE) clean
+librairies : libsndfile libsfocaml
 
 libsndfile:
-	mkdir -p $(prefix)
-	cd $(LIBSNDFILESRC) && ./configure --prefix="$(rootdir)/$(prefix)" --exec_prefix="$(rootdir)/$(prefix)"
-	cd $(LIBSNDFILESRC) && make
-	cd $(LIBSNDFILESRC) && make install
+	mkdir -p $(DESTDIR)
+	cd $(LIBSNDFILE_SRCDIR) && ./configure --prefix="$(DESTDIR)" --exec_prefix="$(DESTDIR)"
+	cd $(LIBSNDFILE_SRCDIR) && make
+	cd $(LIBSNDFILE_SRCDIR) && make install
+	cd $(LIBSNDFILE_SRCDIR) && make clean
+
+libsfocaml:
+	cd $(LIBSFOCAML_SRCDIR) && PKG_CONFIG_PATH=$(DESTDIR)/lib/pkgconfig
+	cd $(LIBSFOCAML_SRCDIR) && make
+	cd $(LIBSFOCAML_SRCDIR) #&& make clean
 
-.PHONY: clean mrproper help libsndfile
+.PHONY: clean mrproper help libsndfile libsfocaml
 
 help :
 	@echo "make or make all : compile librairies"
 	@echo "make clean : remove all object files"
 
 clean:
-	@(cd $(LIBSNDFILESRC) && $(MAKE) clean)
+	@(cd $(LIBSNDFILE_SRCDIR) && $(MAKE) clean)
 	@(rm -f *~)
 
 mrproper: clean
-	@(cd $(LIBSNDFILESRC) && $(MAKE) clean)
-
-
-# Library paths for OCaml and libsndfile-ocaml
-# OCAML_INCLUDE_PATH
-# SNDFILE_PATH
-OCAML_INCLUDE_PATH = /usr/local/lib/ocaml
-SNDFILE_PATH = /Users/karimbarkati/Boulot/2013-07-CRI/Interpretor/libsndfile-ocaml
+	rm -rf $(DESTDIR)