From 224d1f3804fae9e82a590a33170bf6276da572cc Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 7 Sep 2019 14:18:34 +0000 Subject: [PATCH] Makefile: Set some target specific optimisations --- Makefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c674915..5ba4536 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,23 @@ -CFLAGS ?= -g -O3 -mavx -flto -DNDEBUG +MACHINE := $(shell $(CC) -dumpmachine) +ARCH := $(firstword $(subst -, ,$(MACHINE))) +BUILD_DIR ?= build-$(MACHINE) + +ifeq ($(ARCH),x86_64) + ARCH_CFLAGS := -mavx +else +ifeq ($(ARCH),arm) + ARCH_CFLAGS := -mfpu=neon +endif # end arm block +endif # end x86_64 block + +CFLAGS ?= -g -O3 $(ARCH_CFLAGS) -flto -DNDEBUG LDFLAGS ?= -flto -BUILD_DIR ?= build-$(shell uname -m) DSO_NAME=libneatvnc DSO_MAJOR=0 DSO_MINOR=0 -DEPENDENCIES := pixman-1 libpng libuv +DEPENDENCIES := pixman-1 libuv SOURCES := \ src/server.c \