From 0cd03f752edc5077352c21a5c20bcfcf71d84e8e Mon Sep 17 00:00:00 2001
From: Jonathan Helmus <jjhelmus@gmail.com>
Date: Wed, 22 Aug 2018 21:39:56 -0500
Subject: [PATCH 1/3] cross

---
 Makefile           | 12 ++++++------
 Makefile-libbz2_so | 13 +++++++++++--
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index f8a1772..4771d27 100644
--- a/Makefile
+++ b/Makefile
@@ -15,16 +15,16 @@
 SHELL=/bin/sh
 
 # To assist in cross-compiling
-CC=gcc
-AR=ar
-RANLIB=ranlib
-LDFLAGS=
+CC?=gcc
+AR?=ar
+RANLIB?=ranlib
 
 BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
+CFLAGS?=-Wall -Winline -O2 -g
+CFLAGS=$(CFLAGS) $(BIGFILES)
 
 # Where you want it installed when you do 'make install'
-PREFIX=/usr/local
+PREFIX=$PREFIX
 
 
 OBJS= blocksort.o  \
diff --git a/Makefile-libbz2_so b/Makefile-libbz2_so
index fb0f230..ad7955d 100644
--- a/Makefile-libbz2_so
+++ b/Makefile-libbz2_so
@@ -22,9 +22,18 @@
 
 
 SHELL=/bin/sh
-CC=gcc
+
+# To assist in cross-compiling
+CC?=gcc
+AR?=ar
+RANLIB?=ranlib
+
 BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
+CFLAGS?=-Wall -Winline -O2 -g
+CFLAGS=$(CFLAGS) $(BIGFILES)
+
+# Where you want it installed when you do 'make install'
+PREFIX=$PREFIX
 
 OBJS= blocksort.o  \
       huffman.o    \
