blob: c608945a0ef5af03103a53b51f698dedff7b6c5f [file] [log] [blame]
Cyrill Gorcunovd97b46a2012-05-31 16:26:44 -07001uname_M := $(shell uname -m 2>/dev/null || echo not)
2ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
3ifeq ($(ARCH),i386)
4 ARCH := X86
5 CFLAGS := -DCONFIG_X86_32 -D__i386__
6endif
7ifeq ($(ARCH),x86_64)
8 ARCH := X86
9 CFLAGS := -DCONFIG_X86_64 -D__x86_64__
10endif
11
12CFLAGS += -I../../../../arch/x86/include/generated/
13CFLAGS += -I../../../../include/
14CFLAGS += -I../../../../usr/include/
15CFLAGS += -I../../../../arch/x86/include/
16
17all:
18ifeq ($(ARCH),X86)
Dave Young63d23362012-12-17 16:04:47 -080019 gcc $(CFLAGS) kcmp_test.c -o kcmp_test
Cyrill Gorcunovd97b46a2012-05-31 16:26:44 -070020else
21 echo "Not an x86 target, can't build kcmp selftest"
22endif
23
Dave Young63d23362012-12-17 16:04:47 -080024run_tests: all
Cyrill Gorcunovd97b46a2012-05-31 16:26:44 -070025 ./kcmp_test
26
27clean:
28 rm -fr ./run_test
29 rm -fr ./test-file