From e605868a9c9924e3d68ef0b04b247c297e58bb05 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 14 Oct 2024 18:23:30 +0200 Subject: Rename config.mk to config-x86.mk and add config-portable.mk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 11 ++++++++++- config-portable.mk | 14 ++++++++++++++ config-x86.mk | 14 ++++++++++++++ config.mk | 14 -------------- 4 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 config-portable.mk create mode 100644 config-x86.mk delete mode 100644 config.mk diff --git a/Makefile b/Makefile index f4504f2..46650fd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,15 @@ .POSIX: -CONFIGFILE = config.mk +CONFIGFILE = config-x86.mk +# config-x86.mk is the default because it is compatible +# with and optimal for most machines, and if it is not +# supported, the compilation will immediately fail. It +# enables optimisations on x86 CPU's that have the +# required features. +# +# config-portable.mk is available for exotic CPU's +# and compiler that do not support the features required +# for the optimisations. include $(CONFIGFILE) OS = linux diff --git a/config-portable.mk b/config-portable.mk new file mode 100644 index 0000000..4a92176 --- /dev/null +++ b/config-portable.mk @@ -0,0 +1,14 @@ +PREFIX = /usr +MANPREFIX = $(PREFIX)/share/man + +CC = cc -std=c11 + +CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 +CFLAGS = -Wall -O3 +LDFLAGS = -s + +# You can add -DALLOCA_LIMIT=# to CPPFLAGS, where # is a size_t +# value, to put a limit on how large allocation the library is +# allowed to make with alloca(3). For buffers that can have any +# size this limit will be used if it wants to allocate a larger +# buffer. Choose 0 to use malloc(3) instead of alloca(3). diff --git a/config-x86.mk b/config-x86.mk new file mode 100644 index 0000000..a79e63f --- /dev/null +++ b/config-x86.mk @@ -0,0 +1,14 @@ +PREFIX = /usr +MANPREFIX = $(PREFIX)/share/man + +CC = cc -std=c11 + +CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 +CFLAGS = -Wall -O3 -msse4 -msha +LDFLAGS = -s + +# You can add -DALLOCA_LIMIT=# to CPPFLAGS, where # is a size_t +# value, to put a limit on how large allocation the library is +# allowed to make with alloca(3). For buffers that can have any +# size this limit will be used if it wants to allocate a larger +# buffer. Choose 0 to use malloc(3) instead of alloca(3). diff --git a/config.mk b/config.mk deleted file mode 100644 index a79e63f..0000000 --- a/config.mk +++ /dev/null @@ -1,14 +0,0 @@ -PREFIX = /usr -MANPREFIX = $(PREFIX)/share/man - -CC = cc -std=c11 - -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -CFLAGS = -Wall -O3 -msse4 -msha -LDFLAGS = -s - -# You can add -DALLOCA_LIMIT=# to CPPFLAGS, where # is a size_t -# value, to put a limit on how large allocation the library is -# allowed to make with alloca(3). For buffers that can have any -# size this limit will be used if it wants to allocate a larger -# buffer. Choose 0 to use malloc(3) instead of alloca(3). -- cgit v1.2.3-70-g09d2