diff --git a/Makefile b/Makefile index 046e11a9..ed7d3cb4 100755 --- a/Makefile +++ b/Makefile @@ -34,6 +34,12 @@ else MKDIR := mkdir endif +ifeq ($(CONF),native_release) +override CONF := release +LDFLAGS += -march=native -mtune=native +CFLAGS += -march=native -mtune=native +endif + # Set compilation and linkage flags based on target, platform and configuration CFLAGS += -Werror -Wall -std=gnu11 -ICore -D_GNU_SOURCE -DVERSION="$(VERSION)" -I. -D_USE_MATH_DEFINES @@ -70,7 +76,7 @@ LDFLAGS += -flto CFLAGS += -flto endif else -$(error Invalid value for CONF: $(CONF). Use "debug" or "release") +$(error Invalid value for CONF: $(CONF). Use "debug", "release" or "native_release") endif # Define our targets diff --git a/README.md b/README.md index 88ff2434..0eb4599c 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,6 @@ On Windows, SameBoy also requires: * [GnuWin](http://gnuwin32.sourceforge.net/) * Running vcvars32 before running make. Make sure all required tools and libraries are in %PATH% and %lib%, repsectively. -To compile, simply run `make`. The targets are cocoa (Default for OS X), sdl (Default for everything else), bootroms and tester. You may also specify CONF=debug (default) or CONF=release to control optimization and symbols, and specify BOOTROMS_DIR=... to a directory containing precompiled dmg_boot.bin and cgb_boot.bin files, otherwise the build system will compile and use SameBoy's own boot ROMs. +To compile, simply run `make`. The targets are cocoa (Default for OS X), sdl (Default for everything else), bootroms and tester. You may also specify CONF=debug (default), CONF=release or CONF=native_release to control optimization and symbols. native_release is faster than release, but is optimized to the host's CPU and therefore is not portable. You may set BOOTROMS_DIR=... to a directory containing precompiled dmg_boot.bin and cgb_boot.bin files, otherwise the build system will compile and use SameBoy's own boot ROMs. -SameBoy was compiled and tested on OS X, Ubuntu and Windows 7 32-bit. +SameBoy was compiled and tested on macOS, Ubuntu and 32-bit Windows 7.