From 3c73ab3765ce0a46f2fe29a44db58ebb6867f6af Mon Sep 17 00:00:00 2001
From: Ilya Shlyakhter <ilya@broadinstitute.org>
Date: Wed, 1 Aug 2018 20:41:26 -0400
Subject: [PATCH] changed jni makefiles to be more standards-compatible

---
 jni/makefile.linux | 12 ++++++------
 jni/makefile.osx   | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/jni/makefile.linux b/jni/makefile.linux
index b46ec80..ff879b0 100755
--- a/jni/makefile.linux
+++ b/jni/makefile.linux
@@ -1,14 +1,14 @@
-CC=gcc
-INCS=-I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/linux"
-CFLAGS=-O3 -Wall -std=c99 -fPIC
-LDFLAGS=-O3 -Wall -std=c99 -fPIC -shared
+#CC=gcc
+BBMAP_CPPFLAGS=-I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/linux"
+BBMAP_CFLAGS=-O3 -Wall -std=c99 -fPIC
+BBMAP_LDFLAGS=-O3 -Wall -std=c99 -fPIC -shared
 OBJ=BandedAlignerJNI.o MultiStateAligner11tsJNI.o BBMergeOverlapper.o
 
 %.o: %.c
-	$(CC) $(CFLAGS) $(INCS) -c -o $@ $<
+	$(CC) $(BBMAP_CPPFLAGS) $(CPPFLAGS) $(BBMAP_CFLAGS) $(CFLAGS) -c -o $@ $<
 
 libbbtoolsjni.so: $(OBJ)
-	$(CC) -o $@ $^ $(LDFLAGS)
+	$(CC) -o $@ $^ $(BBMAP_LDFLAGS) $(LDFLAGS)
 
 .PHONY: clean
 
diff --git a/jni/makefile.osx b/jni/makefile.osx
index 94b78d1..30eca25 100755
--- a/jni/makefile.osx
+++ b/jni/makefile.osx
@@ -1,14 +1,14 @@
-CC=gcc
-INCS=-I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/darwin"
-CFLAGS=-O3 -Wall -std=c99 -fPIC
-LDFLAGS=-O3 -Wall -std=c99 -fPIC -dynamiclib
+#CC=gcc
+BBMAP_CPPFLAGS=-I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/darwin"
+BBMAP_CFLAGS=-O3 -Wall -std=c99 -fPIC
+BBMAP_LDFLAGS=-O3 -Wall -std=c99 -fPIC -dynamiclib
 OBJ=BandedAlignerJNI.o MultiStateAligner11tsJNI.o BBMergeOverlapper.o
 
 %.o: %.c
-	$(CC) $(CFLAGS) $(INCS) -c -o $@ $<
+	$(CC) $(BBMAP_CPPFLAGS) $(CPPFLAGS) $(BBMAP_CFLAGS) $(CFLAGS) -c -o $@ $<
 
 libbbtoolsjni.dylib: $(OBJ)
-	$(CC) -o $@ $^ $(LDFLAGS)
+	$(CC) -o $@ $^ $(BBMAP_LDFLAGS) $(LDFLAGS)
 
 .PHONY: clean
 
-- 
2.18.0

