diff --git a/external_libs/mvtnorm/Makefile b/external_libs/mvtnorm/Makefile index ac3d3893..29f883db 100644 --- a/external_libs/mvtnorm/Makefile +++ b/external_libs/mvtnorm/Makefile @@ -5,8 +5,11 @@ CC ?= gcc FC ?= gfortran UNAME_S := $(shell uname -s) +UNAME_M := $(shell uname -m) ifeq ($(UNAME_S),Darwin) - FLAG += -arch x86_64 + ifeq ($(UNAME_M),x86_64) + FLAG += -arch x86_64 + endif endif libMvtnorm.a: mvtnorm.o mvt.o randomF77.o diff --git a/external_libs/pgenlib/Makefile b/external_libs/pgenlib/Makefile index 262d920b..5ed281d8 100644 --- a/external_libs/pgenlib/Makefile +++ b/external_libs/pgenlib/Makefile @@ -7,8 +7,11 @@ CXXFLAGS = -O3 -Wall -std=c++11 CFLAGS = UNAME_S := $(shell uname -s) +UNAME_M := $(shell uname -m) ifeq ($(UNAME_S),Darwin) - CXXFLAGS += -arch x86_64 + ifeq ($(UNAME_M),x86_64) + CXXFLAGS += -arch x86_64 + endif endif OBJECTS = $(patsubst %.cc,%.o,$(wildcard ./include/*.cc)) $(patsubst %.cpp,%.o,$(wildcard *.cpp)) $(patsubst %.cc,%.o,$(wildcard *.cc)) diff --git a/external_libs/qf/Makefile b/external_libs/qf/Makefile index 3d0341ac..f139e65f 100644 --- a/external_libs/qf/Makefile +++ b/external_libs/qf/Makefile @@ -3,8 +3,11 @@ CXX ?= g++ CXXFLAGS = -O2 -DNDEBUG -fPIC UNAME_S := $(shell uname -s) +UNAME_M := $(shell uname -m) ifeq ($(UNAME_S),Darwin) - CXXFLAGS += -arch x86_64 + ifeq ($(UNAME_M),x86_64) + CXXFLAGS += -arch x86_64 + endif endif qf.a: qfc.o diff --git a/external_libs/quadpack/Makefile b/external_libs/quadpack/Makefile index e160de35..f70f0b1f 100644 --- a/external_libs/quadpack/Makefile +++ b/external_libs/quadpack/Makefile @@ -3,8 +3,11 @@ AR ?= ar FC ?= gfortran UNAME_S := $(shell uname -s) +UNAME_M := $(shell uname -m) ifeq ($(UNAME_S),Darwin) - FLAG += -arch x86_64 + ifeq ($(UNAME_M),x86_64) + FLAG += -arch x86_64 + endif endif OBJECTS = $(patsubst %.f,%.o,$(wildcard ./*.f)) diff --git a/external_libs/remeta/Makefile b/external_libs/remeta/Makefile index 543c5c7e..9d5f2aad 100644 --- a/external_libs/remeta/Makefile +++ b/external_libs/remeta/Makefile @@ -12,8 +12,11 @@ ifneq ($(strip $(HTSLIB_PATH)),) # defined externally endif UNAME_S := $(shell uname -s) +UNAME_M := $(shell uname -m) ifeq ($(UNAME_S),Darwin) - CXXFLAGS += -arch x86_64 + ifeq ($(UNAME_M),x86_64) + CXXFLAGS += -arch x86_64 + endif endif OBJECTS = bgz_writer.o regenie_ld_matrix_writer.o