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

View file

@ -1,7 +1,6 @@
# -*- mode: makefile-gmake -*- # -*- mode: makefile-gmake -*-
OS = $(shell uname) OS := $(shell uname)
ARCH = $(shell uname -m)
FC = gfortran FC = gfortran
FFLAGS += -O3 FFLAGS += -O3
@ -9,7 +8,6 @@ FFLAGS += -O3
USEGCC = 1 USEGCC = 1
USECLANG = 0 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) ifeq ($(USECLANG),1)
USEGCC = 0 USEGCC = 0
@ -23,6 +21,10 @@ CFLAGS_add += -fno-gnu89-inline
endif endif
AR = ar 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 default: all
%.c.o: %.c %.c.o: %.c
@ -39,15 +41,15 @@ clean:
# OS-specific stuff # OS-specific stuff
ifeq ($(ARCH),i386) ifeq ($(ARCH),i386)
override ARCH = i387 override ARCH := i387
endif endif
ifeq ($(ARCH),x86_64) ifeq ($(ARCH),x86_64)
override ARCH = amd64 override ARCH := amd64
endif endif
ifeq ($(ARCH),i686) ifeq ($(ARCH),i686)
override ARCH = i387 override ARCH := i387
endif endif
ifneq (,$(findstring MINGW,$(OS))) ifneq (,$(findstring MINGW,$(OS)))