diff --git a/Makefile b/Makefile index 97c9461..cbc7c4e 100644 --- Makefile +++ Makefile @@ -25,10 +25,10 @@ SIMDOBJ := jpegqs_base.o jpegqs_sse2.o jpegqs_avx2.o jpegqs_avx512.o else ifeq ($(SIMD),none) SIMDFLG := -DNO_SIMD else ifeq ($(SIMD),native) -ifneq (,$(filter arm% aarch64,$(ARCH))) -SIMDFLG := -mcpu=native +ifneq (,$(filter arm% aarch64 ppc% Power\ Macintosh,$(ARCH))) +SIMDFLG := -mcpu=native -mtune=native else -SIMDFLG := -march=native +SIMDFLG := -march=native -mtune=native endif else ifeq ($(SIMD),avx512) SIMDFLG := $(SIMD_AVX512) @@ -49,14 +49,20 @@ CFLAGS := -Wall -O2 ifneq (,$(filter e2k,$(ARCH))) CFLAGS := $(filter-out -O2,$(CFLAGS)) -O3 endif +OMPLINK := ifeq ($(OS),Darwin) LDFLAGS := -Wl,-dead_strip ifeq ($(LIBMINIOMP),) -LDFLAGS += -lomp +ifneq (,$(filter gcc%,$(notdir $(CC)))) +OMPLINK := -lgomp +else +OMPLINK := -lomp +endif endif else LDFLAGS := -Wl,--gc-sections -s endif +LDFLAGS += $(OMPLINK) CFLAGS_LIB := $(CFLAGS) $(MFLAGS) $(SIMDFLG) CFLAGS_APP := $(CFLAGS_LIB) -Wextra -pedantic $(MTOPTS)