Cyrill Gorcunov | d97b46a | 2012-05-31 16:26:44 -0700 | [diff] [blame] | 1 | uname_M := $(shell uname -m 2>/dev/null || echo not) |
| 2 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) |
| 3 | ifeq ($(ARCH),i386) |
| 4 | ARCH := X86 |
| 5 | CFLAGS := -DCONFIG_X86_32 -D__i386__ |
| 6 | endif |
| 7 | ifeq ($(ARCH),x86_64) |
| 8 | ARCH := X86 |
| 9 | CFLAGS := -DCONFIG_X86_64 -D__x86_64__ |
| 10 | endif |
| 11 | |
| 12 | CFLAGS += -I../../../../arch/x86/include/generated/ |
| 13 | CFLAGS += -I../../../../include/ |
| 14 | CFLAGS += -I../../../../usr/include/ |
| 15 | CFLAGS += -I../../../../arch/x86/include/ |
| 16 | |
| 17 | all: |
| 18 | ifeq ($(ARCH),X86) |
Dave Young | 63d2336 | 2012-12-17 16:04:47 -0800 | [diff] [blame] | 19 | gcc $(CFLAGS) kcmp_test.c -o kcmp_test |
Cyrill Gorcunov | d97b46a | 2012-05-31 16:26:44 -0700 | [diff] [blame] | 20 | else |
| 21 | echo "Not an x86 target, can't build kcmp selftest" |
| 22 | endif |
| 23 | |
Dave Young | 63d2336 | 2012-12-17 16:04:47 -0800 | [diff] [blame] | 24 | run_tests: all |
Dave Young | ed8ad10 | 2012-12-17 16:04:49 -0800 | [diff] [blame] | 25 | @./kcmp_test || echo "kcmp_test: [FAIL]" |
Cyrill Gorcunov | d97b46a | 2012-05-31 16:26:44 -0700 | [diff] [blame] | 26 | |
| 27 | clean: |
Ramkumar Ramachandra | 1b78715 | 2013-07-03 15:09:21 -0700 | [diff] [blame] | 28 | $(RM) kcmp_test kcmp-test-file |