adapt Makefile to use MYxxxx flags instead

This commit is contained in:
iceman1001 2023-09-15 19:08:24 +02:00
parent 25ab507137
commit 0443a60025

View file

@ -4,6 +4,18 @@ MYINCLUDES = -I../../common/cryptorf
MYCFLAGS =
MYDEFS =
# A better way would be to just try compiling with march and seeing if we succeed
cpu_arch = $(shell uname -m)
ifneq ($(findstring arm64, $(cpu_arch)), )
MYCFLAGS += -mcpu=native
# iOS 'fun'
else ifneq ($(findstring iP, $(cpu_arch)), )
MYCFLAGS += -mcpu=native
else
MYCFLAGS += -march=native
endif
platform = $(shell uname)
# Atomic
@ -11,14 +23,14 @@ platform = $(shell uname)
# but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
# doesn't recognize option --as-needed
ifneq ($(platform),Darwin)
LDLIBS += -lpthread -Wl,--as-needed -latomic -Wl,--no-as-needed
MYLDLIBS += -lpthread -Wl,--as-needed -latomic -Wl,--no-as-needed
endif
BINS = cm sm sma sma_multi
INSTALLTOOLS = $(BINS)
ifeq ($(platform),Darwin)
CXXFLAGS = -std=c++14
MYCXXFLAGS = -std=c++14
endif
include ../../Makefile.host
@ -27,7 +39,7 @@ include ../../Makefile.host
ifneq (,$(findstring MINGW,$(platform)))
# Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
# and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
CFLAGS += -D_ISOC99_SOURCE
MYCFLAGS += -D_ISOC99_SOURCE
endif
cm : $(OBJDIR)/cm.o $(MYOBJS)