Makefile 502 B

12345678910111213141516171819202122232425
  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. CFLAGS += -I../../../../usr/include/
  12. all:
  13. ifeq ($(ARCH),X86)
  14. gcc $(CFLAGS) msgque.c -o msgque_test
  15. else
  16. echo "Not an x86 target, can't build msgque selftest"
  17. endif
  18. run_tests: all
  19. ./msgque_test
  20. clean:
  21. rm -fr ./msgque_test