summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile21
1 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index eb99571..750d35f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,35 @@
EXTRA_CFLAGS =
EXTRA_LIBS =
-ifdef pthread
+
+native ?= 1
+pthread ?= 0
+numa ?= 0
+avx512 ?= 0
+debug ?= 0
+
+ifeq (${native}, 1)
+ EXTRA_CFLAGS += -march=native
+endif
+
+ifeq (${pthread}, 1)
EXTRA_CFLAGS += -DMULTITHREADED -pthread
endif
-ifdef numa
+ifeq (${numa}, 1)
EXTRA_CFLAGS += -DNUMA
EXTRA_LIBS += -lnuma
endif
-ifdef avx512
+ifeq (${avx512}, 1)
EXTRA_CFLAGS += -DHAVE_AVX512
endif
-ifdef debug
+ifeq (${debug}, 1)
EXTRA_CFLAGS += -ggdb
endif
mbw: mbw.c
- gcc -Wall -Wextra -pedantic -O3 -march=native ${EXTRA_CFLAGS} -o mbw mbw.c ${EXTRA_LIBS}
+ gcc -Wall -Wextra -pedantic -O3 ${EXTRA_CFLAGS} -o mbw mbw.c ${EXTRA_LIBS}
.PHONY: clean
clean: