Commit d9adda7c authored by Alexander Kartashov's avatar Alexander Kartashov Committed by Pavel Emelyanov

zdtm: autodetect the target machine v2

Andrew Vagin pointed out that the static testsuite compilation
may run as standalone so the variable ARCH won't be available.

This patch introduces the facility test/zdtm/Makefile.inc
designated to detect the target machine automatically
if the variable ARCH isn't defined. This makefile is supposed
to be included into all test subsuite Makefiles.

Andrew Vagin also pointed out that machine-dependent tests
may be added into non-static subsuites as well so the macro
adding machine-specific headers into CPPFLAGS goes to
the file test/zdtm/Makefile.inc.
Signed-off-by: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 008457e1
ARCH ?= $(shell uname -m | sed \
-e s/i.86/i386/ \
-e s/sun4u/sparc64/ \
-e s/arm.*/arm/ \
-e s/sa110/arm/ \
-e s/s390x/s390/ \
-e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ \
-e s/mips.*/mips/ \
-e s/sh[234].*/sh/)
ifeq ($(ARCH),i386)
ARCH := x86
endif
ifeq ($(ARCH),x86_64)
ARCH := x86
endif
CPPFLAGS += -iquote $(LIBDIR)/arch/$(ARCH)/include
include ../Makefile.inc
CFLAGS = -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
LIB = libzdtmtst.a
......
include ../../Makefile.inc
LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR) -iquote $(LIBDIR)/arch/$(ARCH)/include
override CPPFLAGS += -I$(LIBDIR)
CFLAGS = -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
TST_NOFILE = \
......
include ../../Makefile.inc
LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR)
......
include ../../Makefile.inc
LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment