Skip to content

Commit 7145c7f

Browse files
pablodelaratkanteck
authored andcommitted
Makefile: add architecture to CFLAGS
Signed-off-by: Pablo de Lara <[email protected]>
1 parent 455fdde commit 7145c7f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Makefile.am

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,25 @@ pkginclude_HEADERS += $(sort ${extern_hdrs})
6060
libisal_la_SOURCES = ${lsrc}
6161

6262
if CPU_X86_64
63+
ARCH=-Dx86_64
6364
libisal_la_SOURCES += ${lsrc_x86_64}
6465
other_tests += ${other_tests_x86_64}
6566
endif
6667

6768
if CPU_X86_32
69+
ARCH=-Dx86_32
6870
libisal_la_SOURCES += ${lsrc_x86_32}
6971
other_tests += ${other_tests_x86_32}
7072
endif
7173

7274
if CPU_AARCH64
75+
ARCH=-Daarch64
7376
libisal_la_SOURCES += ${lsrc_aarch64}
7477
other_tests += ${other_tests_aarch64}
7578
endif
7679

7780
if CPU_PPC64LE
81+
ARCH=-Dppc64le
7882
libisal_la_SOURCES += ${lsrc_ppc64le}
7983
other_tests += ${other_tests_ppc64le}
8084
endif
@@ -132,7 +136,7 @@ CCAS = $(as_filter)
132136
EXTRA_DIST += tools/yasm-filter.sh tools/nasm-filter.sh
133137
EXTRA_DIST += tools/yasm-cet-filter.sh tools/nasm-cet-filter.sh
134138

135-
AM_CFLAGS = ${my_CFLAGS} ${INCLUDE} $(src_include) ${D}
139+
AM_CFLAGS = ${my_CFLAGS} ${INCLUDE} $(src_include) ${ARCH} ${D}
136140
if CPU_AARCH64
137141
AM_CCASFLAGS = ${AM_CFLAGS}
138142
else

make.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ endif
122122

123123
D :=
124124
INCLUDE = $(patsubst %,-I%/,$(subst :, ,$(VPATH)))
125-
CFLAGS = $(CFLAGS_$(arch)) $(CFLAGS_$(CC)) $(DEBUG) -O2 $(DEFINES) $(INCLUDE)
125+
CFLAGS = $(CFLAGS_$(arch)) $(CFLAGS_$(CC)) $(DEBUG) -O2 $(DEFINES) $(INCLUDE) -D$(host_cpu)
126126
ASFLAGS = $(ASFLAGS_$(arch)) $(ASFLAGS_$(CC)) $(DEBUG_$(AS)) $(DEFINES) $(INCLUDE)
127127
ARFLAGS = $(ARFLAGS_$(arch))
128128
DEFINES += $(addprefix -D , $D)

0 commit comments

Comments
 (0)