Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. FILES= \
  2. test-hello \
  3. test-stackprotector-all \
  4. test-stackprotector \
  5. test-volatile-register-var \
  6. test-fortify-source \
  7. test-bionic \
  8. test-libelf \
  9. test-glibc \
  10. test-dwarf \
  11. test-libelf-mmap \
  12. test-libelf-getphdrnum \
  13. test-libunwind \
  14. test-libaudit \
  15. test-libslang \
  16. test-gtk2 \
  17. test-gtk2-infobar \
  18. test-libperl \
  19. test-libnuma
  20. CC := $(CC) -MD
  21. all: $(FILES)
  22. BUILD = $(CC) -o $(OUTPUT)$@ $@.c
  23. ###############################
  24. test-hello:
  25. $(BUILD)
  26. test-stackprotector-all:
  27. $(BUILD) -Werror -fstack-protector-all
  28. test-stackprotector:
  29. $(BUILD) -Werror -fstack-protector
  30. test-volatile-register-var:
  31. $(BUILD) -Werror -Wvolatile-register-var
  32. test-fortify-source:
  33. $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
  34. test-bionic:
  35. $(BUILD)
  36. test-libelf:
  37. $(BUILD) -lelf
  38. test-glibc:
  39. $(BUILD)
  40. test-dwarf:
  41. $(BUILD) -ldw
  42. test-libelf-mmap:
  43. $(BUILD) -lelf
  44. test-libelf-getphdrnum:
  45. $(BUILD) -lelf
  46. test-libnuma:
  47. $(BUILD) -lnuma
  48. test-libunwind:
  49. $(BUILD) -lunwind -lunwind-x86_64 -lelf
  50. test-libaudit:
  51. $(BUILD) -laudit
  52. test-libslang:
  53. $(BUILD) -I/usr/include/slang -lslang
  54. test-gtk2:
  55. $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
  56. test-gtk2-infobar:
  57. $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
  58. grep-libs = $(filter -l%,$(1))
  59. strip-libs = $(filter-out -l%,$(1))
  60. PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
  61. PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
  62. PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
  63. PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
  64. FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
  65. test-libperl:
  66. $(BUILD) $(FLAGS_PERL_EMBED)
  67. -include *.d */*.d
  68. ###############################
  69. clean:
  70. rm -f $(FILES) *.d