summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-07-16 18:47:39 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-07-16 18:47:39 +0000
commit93d66bf2c84d7b7b65cd78c96b2f52c0a843ab47 (patch)
treeb3829b845010018ca0ee2a0939e08f207e377711 /Makefile
parentaa37d63a7068d0e55881c627d25d6b35878307f3 (diff)
Allow overriding the output of uname -m and uname -r with the variables
MACHINE and KVERS, respectively. KVERS existed before, but ther ewere still direct uses of uname -r left. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2747 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 13 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index e4f0805..5d3f6fa 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,11 @@ ifeq ($(MAKELEVEL),0)
PWD:=$(shell pwd)
endif
-ARCH:=$(shell uname -m | sed -e s/i.86/i386/)
+ifndef MACHINE
+ MACHINE :=$(shell uname -m)
+endif
+# FIXME: this variable sets ARCH in the kernel Makefile.
+ARCH :=$(shell echo $(MACHINE) | sed -e s/i.86/i386/)
# If you want to build for a kernel other than the current kernel, set KVERS
ifndef KVERS
@@ -94,9 +98,14 @@ HOSTCC=gcc
INSTALL_PREFIX := $(DESTDIR)
CFLAGS+=-I. -O4 -g -Wall
-CFLAGS_PPC:=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
-CFLAGS_X86-64:=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi)
-CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_X86-64)
+ifneq (,$(findstring ppc,$(PACHINE)))
+ CFLAGS += -fsigned-char
+ KFLAGS += -msoft-float -fsigned-char
+endif
+ifneq (,$(findstring x86_64,$(PACHINE)))
+ CFLAGS += -m64
+ KFLAGS += -mcmodel=kernel
+endif
LCFLAGS:=-fPIC $(CFLAGS) -DBUILDING_TONEZONE
KFLAGS:=-I$(KINCLUDES) -O6
KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I$(KSRC)/drivers/net \
@@ -104,9 +113,6 @@ KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I$(KSRC)/drivers/net \
ifneq (,$(wildcard $(KINCLUDES)/linux/modversions.h))
KFLAGS+=-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h
endif
-KFLAGS_PPC:=$(shell if uname -m | grep -q ppc; then echo "-msoft-float -fsigned-char"; fi)
-KFLAGS+=$(KFLAGS_PPC)
-KFLAGS+=$(shell if uname -r | grep -q 2.4; then if uname -m | grep -q x86_64; then echo "-mcmodel=kernel"; fi; fi)
#
# Features are now configured in zconfig.h