diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..954576a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+tools/annotate
+tools/annotate.dSYM
+tools/evolve_grief
+tools/evolve_grief.dSYM
+tools/match_all
+tools/match_all.dSYM
\ No newline at end of file
diff --git a/README.md b/README.md
index 82bc912..f53f97f 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,7 @@ The datasets we used for evaluation are available for download at my [google dri
### Testing the main program
1. Go to tools and compile the match_all utilily: cd tools;make;cd ..,
+(Note that if you are compiling on MacOS, you should do ```make MACOS=yes```)
1. Run ./tools/match_all DETECTOR DESCRIPTOR DATASET to perform the evaluation of a single detector/descriptor combination (e.g. ./tools/match_all star brief GRIEF-dataset/michigan),
1. After the tests finishes, have a look in the dataset/results/ directory for a detector_descriptor.histogram file (e.g. GRIEF-datasets/michigan/results/up-surf_brief.histogram),
1. Run the benchmark on the provided dataset: ./scripts/match_all.sh DATASET.
diff --git a/tools/Makefile b/tools/Makefile
index 87277f7..fdcd73c 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -1,5 +1,10 @@
CC=g++
+# compile for unix by default
+ifndef MACOS
+ MACOS=no
+endif
+
SOURCES=$(TARGET).cpp
OBJECTS=$(SOURCES:.cpp=.o)
@@ -8,7 +13,13 @@ EXECUTABLE=$(TARGET)
#CFLAGS := -Wall -g -O3 -Wfatal-errors -mssse3 -msse2 -march=native
CFLAGS := -ggdb
-LDFLAGS := grief/grief.cpp -Llib -Wl,-rpath='$$ORIGIN/lib' -g `pkg-config opencv --libs`
+LDFLAGS := grief/grief.cpp -Llib -Wl,
+
+# handle unix/apple builds
+ifeq ($(MACOS), no)
+ LDFLAGS := ${LDFLAGS}-rpath='$$ORIGIN/lib'
+endif
+LDFLAGS := ${LDFLAGS} -g `pkg-config opencv --libs`
# OpenCV
#CFLAGS += `pkg-config opencv --cflags`
diff --git a/tools/generate.sh b/tools/generate.sh
index 8a73390..4f6f4b5 100755
--- a/tools/generate.sh
+++ b/tools/generate.sh
@@ -2,6 +2,6 @@ for i in 16 32 64;
do ./grief/generate_code.py grief/test_pairs.txt $i >grief/generated_$i.i;
done
rm evolve_grief
-make evolve_grief
+make MACOS=yes evolve_grief
rm match_all
-make match_all
+make MACOS=yes match_all