From 7145c7f8b497d4599421c1bb3894f63ab3202322 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 2 Jan 2024 10:34:43 +0000 Subject: [PATCH] Makefile: add architecture to CFLAGS Signed-off-by: Pablo de Lara --- Makefile.am | 6 +++++- make.inc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8335c92..3a8e603 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,21 +60,25 @@ pkginclude_HEADERS += $(sort ${extern_hdrs}) libisal_la_SOURCES = ${lsrc} if CPU_X86_64 +ARCH=-Dx86_64 libisal_la_SOURCES += ${lsrc_x86_64} other_tests += ${other_tests_x86_64} endif if CPU_X86_32 +ARCH=-Dx86_32 libisal_la_SOURCES += ${lsrc_x86_32} other_tests += ${other_tests_x86_32} endif if CPU_AARCH64 +ARCH=-Daarch64 libisal_la_SOURCES += ${lsrc_aarch64} other_tests += ${other_tests_aarch64} endif if CPU_PPC64LE +ARCH=-Dppc64le libisal_la_SOURCES += ${lsrc_ppc64le} other_tests += ${other_tests_ppc64le} endif @@ -132,7 +136,7 @@ CCAS = $(as_filter) EXTRA_DIST += tools/yasm-filter.sh tools/nasm-filter.sh EXTRA_DIST += tools/yasm-cet-filter.sh tools/nasm-cet-filter.sh -AM_CFLAGS = ${my_CFLAGS} ${INCLUDE} $(src_include) ${D} +AM_CFLAGS = ${my_CFLAGS} ${INCLUDE} $(src_include) ${ARCH} ${D} if CPU_AARCH64 AM_CCASFLAGS = ${AM_CFLAGS} else diff --git a/make.inc b/make.inc index 16303bd..993cb9c 100644 --- a/make.inc +++ b/make.inc @@ -122,7 +122,7 @@ endif D := INCLUDE = $(patsubst %,-I%/,$(subst :, ,$(VPATH))) -CFLAGS = $(CFLAGS_$(arch)) $(CFLAGS_$(CC)) $(DEBUG) -O2 $(DEFINES) $(INCLUDE) +CFLAGS = $(CFLAGS_$(arch)) $(CFLAGS_$(CC)) $(DEBUG) -O2 $(DEFINES) $(INCLUDE) -D$(host_cpu) ASFLAGS = $(ASFLAGS_$(arch)) $(ASFLAGS_$(CC)) $(DEBUG_$(AS)) $(DEFINES) $(INCLUDE) ARFLAGS = $(ARFLAGS_$(arch)) DEFINES += $(addprefix -D , $D)