comparison Makefile @ 272:cfeb196251e4

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.
author William Astle <lost@l-w.ca>
date Sat, 20 Apr 2013 11:00:11 -0600
parents f6acfc659dd9
children 776a076d1afa
comparison
equal deleted inserted replaced
271:f6acfc659dd9 272:cfeb196251e4
7 #PROGSUFFIX := .exe 7 #PROGSUFFIX := .exe
8 #BUILDTPREFIX=i586-mingw32msvc- 8 #BUILDTPREFIX=i586-mingw32msvc-
9 9
10 DESTDIR ?= /usr/local/bin 10 DESTDIR ?= /usr/local/bin
11 11
12 # C compiler 12 # this are probably pointless but they will make sure
13 CC ?= $(BUILDTPREFIX)cc 13 # the variables are set without overriding the environment
14 # or automatic values from make itself.
15 CC ?= cc
16 AR ?= ar
17 RANLIB ?= ranlib
14 18
15 # ar 19 # Set variables for cross compiling
16 AR ?= $(BUILDTPREFIX)ar 20 ifneq ($(BUILDTPREFIX),)
17 21 CC := $(BUILDTPREFIX)$(CC)
18 # ranlib 22 AR := $(BUILDTPREFIX)$(AR)
19 RANLIB ?= $(BUILDTPREFIX)ranlib 23 RANLIB := $(BUILDTPREFIX)$(RANLIB)
24 endif
20 25
21 CPPFLAGS += -I lwlib -DPACKAGE_STRING='"lwtools 4.7+"' 26 CPPFLAGS += -I lwlib -DPACKAGE_STRING='"lwtools 4.7+"'
22 LDFLAGS += -L$(PWD)/lwlib -llw 27 LDFLAGS += -L$(PWD)/lwlib -llw
23 28
24 CFLAGS ?= -O3 -Wall 29 CFLAGS ?= -O3 -Wall