summaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-23 15:47:35 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-23 15:47:35 +0000
commitfff49ec9f755c942fbd7848533a2b93c2c6f38e3 (patch)
tree5b8d7c50bb95ed7101664adee8711e8ade8819f5 /Rules.mak
parent3914653a35af74142ebc93ebcbef19b2eddccb36 (diff)
Cleanup arch support
Diffstat (limited to 'Rules.mak')
-rw-r--r--Rules.mak15
1 files changed, 11 insertions, 4 deletions
diff --git a/Rules.mak b/Rules.mak
index d61495f29..f83e533e0 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -76,14 +76,21 @@ GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1includ
ARFLAGS=r
-CCFLAGS=$(OPTIMIZATION) -nostdinc $(CPUFLAGS) -Dlinux -D__linux__ -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D__PIC__ -D__LIBC__
-CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS) -fpic
+CCFLAGS=$(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) -Dlinux -D__linux__ -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D__LIBC__
+# Figure out what arch to build...
+ARCH = $(shell uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/' -e 's/arm.*/arm/g')
+
+ifeq ($(ARCH), arm)
+ ARCH_CFLAGS=-fpic
+endif
+
+CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS)
ifeq ($(DODEBUG),true)
- CFLAGS += -Wall -g -D__PIC__
+ CFLAGS += -Wall -g
LDFLAGS = -nostdlib
else
- CFLAGS += -Wall -D__PIC__ #-fomit-frame-pointer
+ CFLAGS += -Wall #-fomit-frame-pointer
LDFLAGS = -s -nostdlib
endif