blob: 8aabd82db9e4a3028c6f8b594304e8896f427c77 [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)
Phong Tran498b4732014-08-29 15:19:06 -07004 ARCH := x86
Cyrill Gorcunovd97b46a2012-05-31 16:26:44 -07005 CFLAGS := -DCONFIG_X86_32 -D__i386__
6endif
7ifeq ($(ARCH),x86_64)
Phong Tran498b4732014-08-29 15:19:06 -07008 ARCH := x86
Cyrill Gorcunovd97b46a2012-05-31 16:26:44 -07009 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:
Phong Tran498b4732014-08-29 15:19:06 -070018ifeq ($(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
Dave Younged8ad102012-12-17 16:04:49 -080025 @./kcmp_test || echo "kcmp_test: [FAIL]"
Cyrill Gorcunovd97b46a2012-05-31 16:26:44 -070026
27clean:
Ramkumar Ramachandra1b787152013-07-03 15:09:21 -070028 $(RM) kcmp_test kcmp-test-file