Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 1 | |
Ingo Molnar | 3ae069c | 2013-09-30 13:37:10 +0200 | [diff] [blame] | 2 | FILES= \ |
| 3 | test-hello \ |
Ingo Molnar | 90ac542 | 2013-09-30 13:48:44 +0200 | [diff] [blame] | 4 | test-stackprotector-all \ |
Ingo Molnar | 430be5a | 2013-10-07 09:47:00 +0200 | [diff] [blame] | 5 | test-stackprotector \ |
Ingo Molnar | c251044 | 2013-09-30 13:58:12 +0200 | [diff] [blame] | 6 | test-volatile-register-var \ |
Ingo Molnar | 1ea6f99 | 2013-10-07 09:38:28 +0200 | [diff] [blame] | 7 | test-fortify-source \ |
Ingo Molnar | 78e9d65 | 2013-09-30 14:11:46 +0200 | [diff] [blame] | 8 | test-bionic \ |
Ingo Molnar | 8f7f800 | 2013-09-30 14:20:25 +0200 | [diff] [blame] | 9 | test-libelf \ |
Ingo Molnar | e12762c | 2013-10-07 10:34:20 +0200 | [diff] [blame] | 10 | test-glibc \ |
Ingo Molnar | 8295d4e | 2013-10-07 10:35:39 +0200 | [diff] [blame] | 11 | test-dwarf \ |
Ingo Molnar | 8869b17 | 2013-09-30 15:02:28 +0200 | [diff] [blame] | 12 | test-libelf-mmap \ |
Ingo Molnar | b7bcef6 | 2013-09-30 14:35:27 +0200 | [diff] [blame] | 13 | test-libelf-getphdrnum \ |
Ingo Molnar | 058f952 | 2013-09-30 14:45:44 +0200 | [diff] [blame] | 14 | test-libunwind \ |
Ingo Molnar | d795a65 | 2013-09-30 14:55:31 +0200 | [diff] [blame] | 15 | test-libaudit \ |
Ingo Molnar | b9498b5 | 2013-09-30 14:57:54 +0200 | [diff] [blame] | 16 | test-libslang \ |
Ingo Molnar | 7ef9e05 | 2013-09-30 15:01:56 +0200 | [diff] [blame] | 17 | test-gtk2 \ |
Ingo Molnar | c7a79e9 | 2013-09-30 15:08:30 +0200 | [diff] [blame] | 18 | test-gtk2-infobar \ |
Ingo Molnar | 7181a67 | 2013-09-30 15:15:36 +0200 | [diff] [blame] | 19 | test-libperl \ |
Ingo Molnar | 9734163 | 2013-09-30 15:18:37 +0200 | [diff] [blame] | 20 | test-libpython \ |
Ingo Molnar | 95d061c | 2013-09-30 15:40:04 +0200 | [diff] [blame] | 21 | test-libpython-version \ |
Ingo Molnar | 3b7646e | 2013-09-30 15:53:31 +0200 | [diff] [blame^] | 22 | test-libbfd \ |
Ingo Molnar | 3ae069c | 2013-09-30 13:37:10 +0200 | [diff] [blame] | 23 | test-libnuma |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 24 | |
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 25 | CC := $(CC) -MD |
| 26 | |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 27 | all: $(FILES) |
| 28 | |
| 29 | BUILD = $(CC) -o $(OUTPUT)$@ $@.c |
| 30 | |
| 31 | ############################### |
| 32 | |
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 33 | test-hello: |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 34 | $(BUILD) |
| 35 | |
Ingo Molnar | 90ac542 | 2013-09-30 13:48:44 +0200 | [diff] [blame] | 36 | test-stackprotector-all: |
| 37 | $(BUILD) -Werror -fstack-protector-all |
| 38 | |
Ingo Molnar | 430be5a | 2013-10-07 09:47:00 +0200 | [diff] [blame] | 39 | test-stackprotector: |
| 40 | $(BUILD) -Werror -fstack-protector |
| 41 | |
Ingo Molnar | c251044 | 2013-09-30 13:58:12 +0200 | [diff] [blame] | 42 | test-volatile-register-var: |
| 43 | $(BUILD) -Werror -Wvolatile-register-var |
| 44 | |
Ingo Molnar | 1ea6f99 | 2013-10-07 09:38:28 +0200 | [diff] [blame] | 45 | test-fortify-source: |
| 46 | $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2 |
| 47 | |
Ingo Molnar | 78e9d65 | 2013-09-30 14:11:46 +0200 | [diff] [blame] | 48 | test-bionic: |
| 49 | $(BUILD) |
| 50 | |
Ingo Molnar | 8f7f800 | 2013-09-30 14:20:25 +0200 | [diff] [blame] | 51 | test-libelf: |
| 52 | $(BUILD) -lelf |
| 53 | |
Ingo Molnar | e12762c | 2013-10-07 10:34:20 +0200 | [diff] [blame] | 54 | test-glibc: |
| 55 | $(BUILD) |
| 56 | |
Ingo Molnar | 8295d4e | 2013-10-07 10:35:39 +0200 | [diff] [blame] | 57 | test-dwarf: |
| 58 | $(BUILD) -ldw |
| 59 | |
Ingo Molnar | 8869b17 | 2013-09-30 15:02:28 +0200 | [diff] [blame] | 60 | test-libelf-mmap: |
| 61 | $(BUILD) -lelf |
| 62 | |
Ingo Molnar | b7bcef6 | 2013-09-30 14:35:27 +0200 | [diff] [blame] | 63 | test-libelf-getphdrnum: |
| 64 | $(BUILD) -lelf |
| 65 | |
Ingo Molnar | 3ae069c | 2013-09-30 13:37:10 +0200 | [diff] [blame] | 66 | test-libnuma: |
| 67 | $(BUILD) -lnuma |
| 68 | |
Ingo Molnar | 058f952 | 2013-09-30 14:45:44 +0200 | [diff] [blame] | 69 | test-libunwind: |
| 70 | $(BUILD) -lunwind -lunwind-x86_64 -lelf |
| 71 | |
Ingo Molnar | d795a65 | 2013-09-30 14:55:31 +0200 | [diff] [blame] | 72 | test-libaudit: |
| 73 | $(BUILD) -laudit |
| 74 | |
Ingo Molnar | b9498b5 | 2013-09-30 14:57:54 +0200 | [diff] [blame] | 75 | test-libslang: |
| 76 | $(BUILD) -I/usr/include/slang -lslang |
| 77 | |
Ingo Molnar | 7ef9e05 | 2013-09-30 15:01:56 +0200 | [diff] [blame] | 78 | test-gtk2: |
| 79 | $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) |
| 80 | |
Ingo Molnar | c7a79e9 | 2013-09-30 15:08:30 +0200 | [diff] [blame] | 81 | test-gtk2-infobar: |
| 82 | $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) |
| 83 | |
Ingo Molnar | 7181a67 | 2013-09-30 15:15:36 +0200 | [diff] [blame] | 84 | grep-libs = $(filter -l%,$(1)) |
| 85 | strip-libs = $(filter-out -l%,$(1)) |
| 86 | |
| 87 | PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) |
| 88 | PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) |
| 89 | PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) |
| 90 | PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` |
| 91 | FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) |
| 92 | |
| 93 | test-libperl: |
| 94 | $(BUILD) $(FLAGS_PERL_EMBED) |
| 95 | |
Ingo Molnar | 9734163 | 2013-09-30 15:18:37 +0200 | [diff] [blame] | 96 | override PYTHON := python |
| 97 | override PYTHON_CONFIG := python-config |
| 98 | |
| 99 | escape-for-shell-sq = $(subst ','\'',$(1)) |
| 100 | shell-sq = '$(escape-for-shell-sq)' |
| 101 | |
| 102 | PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG)) |
| 103 | |
| 104 | PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) |
| 105 | PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS)) |
| 106 | PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) |
| 107 | PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) |
| 108 | FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS) |
| 109 | |
| 110 | test-libpython: |
| 111 | $(BUILD) $(FLAGS_PYTHON_EMBED) |
| 112 | |
Ingo Molnar | 95d061c | 2013-09-30 15:40:04 +0200 | [diff] [blame] | 113 | test-libpython-version: |
| 114 | $(BUILD) $(FLAGS_PYTHON_EMBED) |
| 115 | |
Ingo Molnar | 3b7646e | 2013-09-30 15:53:31 +0200 | [diff] [blame^] | 116 | test-libbfd: |
| 117 | $(BUILD) -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl |
| 118 | |
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 119 | -include *.d */*.d |
| 120 | |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 121 | ############################### |
| 122 | |
| 123 | clean: |
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 124 | rm -f $(FILES) *.d |