summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2019-11-11 08:52:15 +0000
committerwhitequark <whitequark@whitequark.org>2020-04-30 02:17:23 +0000
commit128ba6ebc5ec210cd9660f3f032f9a555dc79ec6 (patch)
tree4669ae41df8cd78d5f844aa0ff8ba27ef1548fda /Makefile
parentf2316ab7c818c5d5519a12d34b17b4845521d3f2 (diff)
downloadabc-128ba6ebc5ec210cd9660f3f032f9a555dc79ec6.tar.gz
abc-128ba6ebc5ec210cd9660f3f032f9a555dc79ec6.tar.bz2
abc-128ba6ebc5ec210cd9660f3f032f9a555dc79ec6.zip
Allow changing the `ar` binary.
This is useful for cross-compilation, when build `ar` cannot handle the target object files. The invocation of `ranlib` is replaced with `ar s`, which is equivalent and simplifies the build system a bit.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index e0e8b8f0..583bc25b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
CC := gcc
CXX := g++
+AR := ar
LD := $(CXX)
MSG_PREFIX ?=
@@ -8,6 +9,7 @@ ABCSRC = .
$(info $(MSG_PREFIX)Using CC=$(CC))
$(info $(MSG_PREFIX)Using CXX=$(CXX))
+$(info $(MSG_PREFIX)Using AR=$(AR))
$(info $(MSG_PREFIX)Using LD=$(LD))
PROG := abc
@@ -215,8 +217,7 @@ $(PROG): $(OBJ)
lib$(PROG).a: $(LIBOBJ)
@echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@)
- $(VERBOSE)ar rv $@ $?
- $(VERBOSE)ranlib $@
+ $(VERBOSE)$(AR) rsv $@ $?
lib$(PROG).so: $(LIBOBJ)
@echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@)