Makefile: add architecture to CFLAGS

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
Pablo de Lara 2024-01-02 10:34:43 +00:00
parent 75af1c4d4e
commit da928194b4
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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)