Stanislav Kinsbursky | 3a66553 | 2013-01-04 15:34:56 -0800 | [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../../../../usr/include/ |
| 13 | |
| 14 | all: |
| 15 | ifeq ($(ARCH),X86) |
| 16 | gcc $(CFLAGS) msgque.c -o msgque_test |
| 17 | else |
| 18 | echo "Not an x86 target, can't build msgque selftest" |
| 19 | endif |
| 20 | |
| 21 | run_tests: all |
| 22 | ./msgque_test |
| 23 | |
| 24 | clean: |
| 25 | rm -fr ./msgque_test |