lexer.ml
*.mli
.depend*
-examples/*/output*
+output*.wav
+output*.csv
*.lo
*.Po
*.Plo
interpretor/lib/src/libsndfile-1.0.25/examples/.libs/sndfilehandle
interpretor/lib/src/libsndfile-1.0.25/src/stamp-h1
interpretor/lib/src/libsndfile-1.0.25/tests/test_wrapper.sh
+interpretor/lib/src/libsndfile-ocaml/sndfile.cma
+interpretor/lib/src/libsndfile-ocaml/sndfile.cmxa
+# Faustine top-level Makefile.
+
+EXEC = faustine
SRC_DIR = interpretor
PREPROCESSOR_DIR = $(SRC_DIR)/preprocessor/faust-0.9.47mr3
OUTPUTSOUNDS_DIR = examples/output_sounds
-EXEC = faustine
DESTDIR ?=
PREFIX ?= /usr/local
-CROSS=i586-mingw32msvc-
-
prefix := $(DESTDIR)$(PREFIX)
arch := $(wildcard architecture/*.*)
all: $(EXEC)
faustine:
- @cp $(SNDFILE_PATH)/sndfile_stub.o $(SRC_DIR)
- @cd $(SRC_DIR) && $(MAKE) opt OCAML_INCLUDE_PATH=$(OCAML_INCLUDE_PATH) SNDFILE_PATH=$(SNDFILE_PATH)
+# @cp $(SNDFILE_PATH)/sndfile_stub.o $(SRC_DIR)
+## Using ocamlopt with 'make opt'
+ @cd $(SRC_DIR) && $(MAKE) opt #OCAML_INCLUDE_PATH=$(OCAML_INCLUDE_PATH) SNDFILE_PATH=$(SNDFILE_PATH)
@cd $(SRC_DIR) && $(MAKE) clean
.PHONY: clean mrproper test help install uninstall
@(cd $(SRC_DIR) && $(MAKE) mrproper)
@(cd $(PREPROCESSOR_DIR) && $(MAKE) clean)
-test:
+test: # TODO, obsolete
@rm -f $(OUTPUTSOUNDS_DIR)/output0.wav
@cd $(SRC_DIR) && ./faustine -d ../dsp_files/sin.dsp
@ls -l $(OUTPUTSOUNDS_DIR)/output0.wav
uninstall :
rm -rf $(prefix)/lib/faustine/
rm -f $(prefix)/bin/faustine
-
-
-# Library paths for OCaml and libsndfile-ocaml
-# OCAML_INCLUDE_PATH
-# SNDFILE_PATH
+# Faustine interpreter Makefile.
+
########################## User's variables #####################
#
# The Caml sources (including camlyacc and camllex source files)
SOURCES = types.ml parser.mly lexer.mll basic.ml symbol.ml aux.ml value.ml signal.ml beam.ml process.ml faustio.ml preprocess.ml main.ml preprocess_stubs.cpp
# The executable file to generate
-
EXEC = faustine
# Path to ocaml include header files
-export OCAML_INCLUDE_PATH
+OCAML_INCLUDE_PATH := $(subst bin,lib,$(shell which ocaml))
# Path to sndfile library
-#SNDFILE_PATH = /home/wang/Desktop/libsndfile-ocaml
-export SNDFILE_PATH
+SNDFILE_PATH := lib/libsndfile
-# Path to Faust.mr2
+# Path to Faust.mr3
FAUST_PATH = preprocessor/faust-0.9.47mr3
# Path to preprocessor library
CAMLOPT_OPTIONS = -p $(GPP_CALL) $(INCLUDE) $(LIBS:.cma=.cmxa)
CAMLDOC_OPTIONS = -d $(OCAML_DOC_PATH) -html $(INCLUDE)
+
CC_OPTIONS = -c -I$(PREPROCESSOR_INCLUDE_PATH) -I$(OCAML_INCLUDE_PATH)
################ End of user's variables #####################
MIDDLE_ML = $(PARSER_MLY:.mly=.ml) $(LEXER_MLL:.mll=.ml)
preprocessor::
- echo "Compling preprocessor..."
+ @echo "Compiling preprocessor..."
cd $(FAUST_PATH) && $(MAKE)
$(EXEC): $(OBJS) $(COBJS) $(CLIBS)
+ @echo "Compiling $(EXEC)..."
$(CAMLC) $(CAMLC_OPTIONS) -o $(EXEC) $(OBJS) $(COBJS) $(CLIBS)
$(EXEC).opt: $(OPTOBJS) $(COBJS) $(CLIBS)
+ @echo "Compiling optimized $(EXEC)..."
$(CAMLOPT) $(CAMLOPT_OPTIONS) -o $(EXEC) $(OPTOBJS) $(COBJS) $(CLIBS)
document: $(SMLYL) $(OBJS)
+ @echo "Compiling documentation..."
$(CAMLDOC) $(CAMLDOC_OPTIONS) $(SMLYL)
main.cmo: main.ml
-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)
+LIBSNDFILEDIR = ../../libsndfile/lib #/home/erikd/Local/lib
CC = gcc
-CFLAGS = -g -W -Wall -Werror
+CFLAGS = -g -W -Wall -Werror -Wno-missing-field-initializers
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
SNDFILE_CFLAGS = $(shell pkg-config --cflags sndfile)
SNDFILE_LIBS = $(shell pkg-config --libs sndfile)
-OCAML_CFLAGS = -I /usr/lib/ocaml/$(shell ocamlopt -version)
+OCAML_BINDIR = $(shell which ocaml)
+OCAML_LIBDIR = $(subst bin,lib,$(OCAML_BINDIR))
+OCAML_CFLAGS = -I $(OCAML_LIBDIR) #/usr/lib/ocaml/$(shell ocamlopt -version)
-LIBSNDFILE = -ccopt -L/home/erikd/Local/lib -cclib -lsndfile -cclib -lm
+LIBSNDFILE = -ccopt -L$(LIBSNDFILEDIR) -cclib -lsndfile -cclib -lm
all: sndfile.cma sndfile.cmxa