# HG changeset patch # User William Astle # Date 1366477211 21600 # Node ID cfeb196251e4e9599a43bcaa6e0f72298c1bb1a3 # Parent f6acfc659dd954b2bd169a6c83713823b828ee01 Fix conditional setting of build tools variables in the makefile As pointed out by Tormod Volden, make automatically sets CC and AR. Instead of a conditional setting of those variables, automatically add BUILDTPREFIX to them if it is set without overriding the values of CC, AR, and RANLIB. Also have extra default conditional settings of those three variables in the event that they happen not to be set for some reason. diff -r f6acfc659dd9 -r cfeb196251e4 Makefile --- a/Makefile Sun Apr 07 01:29:29 2013 -0600 +++ b/Makefile Sat Apr 20 11:00:11 2013 -0600 @@ -9,14 +9,19 @@ DESTDIR ?= /usr/local/bin -# C compiler -CC ?= $(BUILDTPREFIX)cc +# this are probably pointless but they will make sure +# the variables are set without overriding the environment +# or automatic values from make itself. +CC ?= cc +AR ?= ar +RANLIB ?= ranlib -# ar -AR ?= $(BUILDTPREFIX)ar - -# ranlib -RANLIB ?= $(BUILDTPREFIX)ranlib +# Set variables for cross compiling +ifneq ($(BUILDTPREFIX),) +CC := $(BUILDTPREFIX)$(CC) +AR := $(BUILDTPREFIX)$(AR) +RANLIB := $(BUILDTPREFIX)$(RANLIB) +endif CPPFLAGS += -I lwlib -DPACKAGE_STRING='"lwtools 4.7+"' LDFLAGS += -L$(PWD)/lwlib -llw