From 93d66bf2c84d7b7b65cd78c96b2f52c0a843ab47 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Mon, 16 Jul 2007 18:47:39 +0000 Subject: 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 --- Makefile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3