Add CROSS_PREFIX var to make cross-compilation easier
authorJoey Parrish <joey.parrish@gmail.com>
Sun, 30 Oct 2016 17:50:49 +0000 (10:50 -0700)
committerJoey Parrish <joey.parrish@gmail.com>
Sun, 30 Oct 2016 17:50:49 +0000 (10:50 -0700)
Makefile

index 0344ff85580ed58cf7af42bb278df7d57d4be333..2341cf963e61e9358621507f7718c681ff6101cb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,14 @@
 #
-CC       = gcc
-AR       = ar
-RANLIB   = ranlib
-SIZE     = size
-SHLIB    = $(CC) -shared
-STRIP    = strip
-STRIPLIB = $(STRIP) --strip-unneeded
+# Set CROSS_PREFIX to prepend to all compiler tools at once for easier
+# cross-compilation.
+CROSS_PREFIX =
+CC           = $(CROSS_PREFIX)gcc
+AR           = $(CROSS_PREFIX)ar
+RANLIB       = $(CROSS_PREFIX)ranlib
+SIZE         = $(CROSS_PREFIX)size
+STRIP        = $(CROSS_PREFIX)strip
+SHLIB        = $(CC) -shared
+STRIPLIB     = $(STRIP) --strip-unneeded
 
 CFLAGS += -O3 -Wall -pthread