do ARCH autodetection based upon compiler instead of host

This commit is contained in:
Jameson Nash 2013-05-28 09:30:36 -04:00
parent 13cc579520
commit bcefcc3d58
1 changed files with 8 additions and 6 deletions

View File

@ -1,7 +1,6 @@
# -*- mode: makefile-gmake -*-
OS = $(shell uname)
ARCH = $(shell uname -m)
OS := $(shell uname)
FC = gfortran
FFLAGS += -O3
@ -9,7 +8,6 @@ FFLAGS += -O3
USEGCC = 1
USECLANG = 0
CFLAGS_add += -std=c99 -Wall -O3 -I$(OPENLIBM_HOME) -I$(OPENLIBM_HOME)/include -I$(OPENLIBM_HOME)/ld80 -I$(OPENLIBM_HOME)/$(ARCH) -I$(OPENLIBM_HOME)/src -DASSEMBLER -D__BSD_VISIBLE -Wno-implicit-function-declaration
ifeq ($(USECLANG),1)
USEGCC = 0
@ -23,6 +21,10 @@ CFLAGS_add += -fno-gnu89-inline
endif
AR = ar
ARCH := $(shell $(CC) -dumpmachine | sed "s/\([^-]*\).*$$/\1/")
CFLAGS_add += -std=c99 -Wall -O3 -I$(OPENLIBM_HOME) -I$(OPENLIBM_HOME)/include -I$(OPENLIBM_HOME)/ld80 -I$(OPENLIBM_HOME)/$(ARCH) -I$(OPENLIBM_HOME)/src -DASSEMBLER -D__BSD_VISIBLE -Wno-implicit-function-declaration
default: all
%.c.o: %.c
@ -39,15 +41,15 @@ clean:
# OS-specific stuff
ifeq ($(ARCH),i386)
override ARCH = i387
override ARCH := i387
endif
ifeq ($(ARCH),x86_64)
override ARCH = amd64
override ARCH := amd64
endif
ifeq ($(ARCH),i686)
override ARCH = i387
override ARCH := i387
endif
ifneq (,$(findstring MINGW,$(OS)))