+LIBSNDFILEDIR = $(realpath ../../libsndfile/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)
-LIBSNDFILE = -ccopt -L/home/erikd/Local/lib -cclib -lsndfile -cclib -lm
+LIBSNDFILE = -ccopt -L$(LIBSNDFILEDIR) -cclib -lsndfile -cclib -lm
all: sndfile.cma sndfile.cmxa