mirror of
https://github.com/kdlucas/byte-unixbench.git
synced 2025-03-12 00:00:07 +08:00
Add change gcc options via Enviroment arguments.
This commit is contained in:
parent
61663da4fd
commit
c17e1779ea
@ -58,43 +58,52 @@ GL_LIBS = -lGL -lXext -lX11
|
|||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
# OPTIMISATION SETTINGS:
|
# OPTIMISATION SETTINGS:
|
||||||
|
# Use gcc option if defined UB_GCC_OPTIONS via "Environment variable" or "Command-line arguments".
|
||||||
|
ifdef UB_GCC_OPTIONS
|
||||||
|
OPTON = $(UB_GCC_OPTIONS)
|
||||||
|
|
||||||
## Very generic
|
else
|
||||||
#OPTON = -O
|
## Very generic
|
||||||
|
#OPTON = -O
|
||||||
|
|
||||||
## For Linux 486/Pentium, GCC 2.7.x and 2.8.x
|
## For Linux 486/Pentium, GCC 2.7.x and 2.8.x
|
||||||
#OPTON = -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -ffast-math \
|
#OPTON = -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -ffast-math \
|
||||||
# -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2
|
# -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2
|
||||||
|
|
||||||
## For Linux, GCC previous to 2.7.0
|
## For Linux, GCC previous to 2.7.0
|
||||||
#OPTON = -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -ffast-math -m486
|
#OPTON = -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -ffast-math -m486
|
||||||
|
|
||||||
#OPTON = -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -ffast-math \
|
#OPTON = -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -ffast-math \
|
||||||
# -m386 -malign-loops=1 -malign-jumps=1 -malign-functions=1
|
# -m386 -malign-loops=1 -malign-jumps=1 -malign-functions=1
|
||||||
|
|
||||||
## For Solaris 2, or general-purpose GCC 2.7.x
|
## For Solaris 2, or general-purpose GCC 2.7.x
|
||||||
#OPTON = -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall
|
#OPTON = -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall
|
||||||
|
|
||||||
## For Digital Unix v4.x, with DEC cc v5.x
|
## For Digital Unix v4.x, with DEC cc v5.x
|
||||||
#OPTON = -O4
|
#OPTON = -O4
|
||||||
#CFLAGS = -DTIME -std1 -verbose -w0
|
#CFLAGS = -DTIME -std1 -verbose -w0
|
||||||
|
|
||||||
## gcc optimization flags
|
## gcc optimization flags
|
||||||
## (-ffast-math) disables strict IEEE or ISO rules/specifications for math funcs
|
## (-ffast-math) disables strict IEEE or ISO rules/specifications for math funcs
|
||||||
OPTON = -O3 -ffast-math
|
OPTON = -O3 -ffast-math
|
||||||
|
|
||||||
## OS detection. Comment out if gmake syntax not supported by other 'make'.
|
## OS detection. Comment out if gmake syntax not supported by other 'make'.
|
||||||
OSNAME:=$(shell uname -s)
|
OSNAME:=$(shell uname -s)
|
||||||
|
ifeq ($(OSNAME),Linux)
|
||||||
|
# Not all CPU architectures support "-march" or "-march=native".
|
||||||
|
# - Supported : x86, x86_64, ARM, AARCH64, etc..
|
||||||
|
# - Not Supported: RISC-V, IBM Power, etc...
|
||||||
|
OPTON += -march=native -mtune=native
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(OSNAME),Darwin)
|
||||||
|
# (adjust flags or comment out this section for older versions of XCode or OS X)
|
||||||
|
# (-mmacosx-versin-min= requires at least that version of SDK be installed)
|
||||||
|
OPTON += -march=native -mmacosx-version-min=10.10
|
||||||
|
#http://stackoverflow.com/questions/9840207/how-to-use-avx-pclmulqdq-on-mac-os-x-lion/19342603#19342603
|
||||||
|
CFLAGS += -Wa,-q
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(OSNAME),Linux)
|
|
||||||
OPTON += -march=native -mtune=native
|
|
||||||
endif
|
|
||||||
ifeq ($(OSNAME),Darwin)
|
|
||||||
# (adjust flags or comment out this section for older versions of XCode or OS X)
|
|
||||||
# (-mmacosx-versin-min= requires at least that version of SDK be installed)
|
|
||||||
OPTON += -march=native -mmacosx-version-min=10.10
|
|
||||||
#http://stackoverflow.com/questions/9840207/how-to-use-avx-pclmulqdq-on-mac-os-x-lion/19342603#19342603
|
|
||||||
CFLAGS += -Wa,-q
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user