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= \ |
Ingo Molnar | f1138ec | 2013-10-02 09:54:43 +0200 | [diff] [blame] | 3 | test-all \ |
| 4 | test-backtrace \ |
Ingo Molnar | 78e9d65 | 2013-09-30 14:11:46 +0200 | [diff] [blame] | 5 | test-bionic \ |
Ingo Molnar | 8295d4e | 2013-10-07 10:35:39 +0200 | [diff] [blame] | 6 | test-dwarf \ |
Ingo Molnar | f1138ec | 2013-10-02 09:54:43 +0200 | [diff] [blame] | 7 | test-fortify-source \ |
| 8 | test-glibc \ |
Ingo Molnar | 7ef9e05 | 2013-09-30 15:01:56 +0200 | [diff] [blame] | 9 | test-gtk2 \ |
Ingo Molnar | c7a79e9 | 2013-09-30 15:08:30 +0200 | [diff] [blame] | 10 | test-gtk2-infobar \ |
Ingo Molnar | f1138ec | 2013-10-02 09:54:43 +0200 | [diff] [blame] | 11 | test-hello \ |
| 12 | test-libaudit \ |
| 13 | test-libbfd \ |
Ingo Molnar | 1c47661 | 2013-10-02 15:15:09 +0200 | [diff] [blame] | 14 | test-liberty \ |
| 15 | test-liberty-z \ |
| 16 | test-cplus-demangle \ |
Ingo Molnar | f1138ec | 2013-10-02 09:54:43 +0200 | [diff] [blame] | 17 | test-libelf \ |
| 18 | test-libelf-getphdrnum \ |
| 19 | test-libelf-mmap \ |
| 20 | test-libnuma \ |
Ingo Molnar | 7181a67 | 2013-09-30 15:15:36 +0200 | [diff] [blame] | 21 | test-libperl \ |
Ingo Molnar | 9734163 | 2013-09-30 15:18:37 +0200 | [diff] [blame] | 22 | test-libpython \ |
Ingo Molnar | 95d061c | 2013-09-30 15:40:04 +0200 | [diff] [blame] | 23 | test-libpython-version \ |
Ingo Molnar | f1138ec | 2013-10-02 09:54:43 +0200 | [diff] [blame] | 24 | test-libslang \ |
| 25 | test-libunwind \ |
Linus Torvalds | f47671e | 2013-11-14 08:51:29 +0900 | [diff] [blame] | 26 | test-libunwind-debug-frame \ |
Ingo Molnar | 34ef216 | 2013-09-30 16:46:49 +0200 | [diff] [blame] | 27 | test-on-exit \ |
Ingo Molnar | f1138ec | 2013-10-02 09:54:43 +0200 | [diff] [blame] | 28 | test-stackprotector-all \ |
David Ahern | 87419c9 | 2013-10-29 10:43:16 -0600 | [diff] [blame] | 29 | test-timerfd |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 30 | |
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 31 | CC := $(CC) -MD |
| 32 | |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 33 | all: $(FILES) |
| 34 | |
Jean Pihet | 1448fef | 2013-12-10 13:24:04 +0100 | [diff] [blame^] | 35 | BUILD = $(CC) $(CFLAGS) -o $(OUTPUT)$@ $@.c $(LDFLAGS) |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 36 | |
| 37 | ############################### |
| 38 | |
Ingo Molnar | baa9c30 | 2013-10-01 14:14:31 +0200 | [diff] [blame] | 39 | test-all: |
Jean Pihet | 1448fef | 2013-12-10 13:24:04 +0100 | [diff] [blame^] | 40 | $(BUILD) -Werror -fstack-protector-all -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl |
Ingo Molnar | baa9c30 | 2013-10-01 14:14:31 +0200 | [diff] [blame] | 41 | |
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 42 | test-hello: |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 43 | $(BUILD) |
| 44 | |
Ingo Molnar | 90ac542 | 2013-09-30 13:48:44 +0200 | [diff] [blame] | 45 | test-stackprotector-all: |
| 46 | $(BUILD) -Werror -fstack-protector-all |
| 47 | |
Ingo Molnar | 1ea6f99 | 2013-10-07 09:38:28 +0200 | [diff] [blame] | 48 | test-fortify-source: |
| 49 | $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2 |
| 50 | |
Ingo Molnar | 78e9d65 | 2013-09-30 14:11:46 +0200 | [diff] [blame] | 51 | test-bionic: |
| 52 | $(BUILD) |
| 53 | |
Ingo Molnar | 8f7f800 | 2013-09-30 14:20:25 +0200 | [diff] [blame] | 54 | test-libelf: |
| 55 | $(BUILD) -lelf |
| 56 | |
Ingo Molnar | e12762c | 2013-10-07 10:34:20 +0200 | [diff] [blame] | 57 | test-glibc: |
| 58 | $(BUILD) |
| 59 | |
Ingo Molnar | 8295d4e | 2013-10-07 10:35:39 +0200 | [diff] [blame] | 60 | test-dwarf: |
| 61 | $(BUILD) -ldw |
| 62 | |
Ingo Molnar | 8869b17 | 2013-09-30 15:02:28 +0200 | [diff] [blame] | 63 | test-libelf-mmap: |
| 64 | $(BUILD) -lelf |
| 65 | |
Ingo Molnar | b7bcef6 | 2013-09-30 14:35:27 +0200 | [diff] [blame] | 66 | test-libelf-getphdrnum: |
| 67 | $(BUILD) -lelf |
| 68 | |
Ingo Molnar | 3ae069c | 2013-09-30 13:37:10 +0200 | [diff] [blame] | 69 | test-libnuma: |
| 70 | $(BUILD) -lnuma |
| 71 | |
Ingo Molnar | 058f952 | 2013-09-30 14:45:44 +0200 | [diff] [blame] | 72 | test-libunwind: |
Jean Pihet | 1448fef | 2013-12-10 13:24:04 +0100 | [diff] [blame^] | 73 | $(BUILD) -lelf |
Ingo Molnar | 058f952 | 2013-09-30 14:45:44 +0200 | [diff] [blame] | 74 | |
Ingo Molnar | e310718 | 2013-11-14 08:25:24 +0100 | [diff] [blame] | 75 | test-libunwind-debug-frame: |
Jean Pihet | 1448fef | 2013-12-10 13:24:04 +0100 | [diff] [blame^] | 76 | $(BUILD) -lelf |
Ingo Molnar | e310718 | 2013-11-14 08:25:24 +0100 | [diff] [blame] | 77 | |
Ingo Molnar | d795a65 | 2013-09-30 14:55:31 +0200 | [diff] [blame] | 78 | test-libaudit: |
| 79 | $(BUILD) -laudit |
| 80 | |
Ingo Molnar | b9498b5 | 2013-09-30 14:57:54 +0200 | [diff] [blame] | 81 | test-libslang: |
| 82 | $(BUILD) -I/usr/include/slang -lslang |
| 83 | |
Ingo Molnar | 7ef9e05 | 2013-09-30 15:01:56 +0200 | [diff] [blame] | 84 | test-gtk2: |
| 85 | $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) |
| 86 | |
Ingo Molnar | c7a79e9 | 2013-09-30 15:08:30 +0200 | [diff] [blame] | 87 | test-gtk2-infobar: |
| 88 | $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) |
| 89 | |
Ingo Molnar | 7181a67 | 2013-09-30 15:15:36 +0200 | [diff] [blame] | 90 | grep-libs = $(filter -l%,$(1)) |
| 91 | strip-libs = $(filter-out -l%,$(1)) |
| 92 | |
| 93 | PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) |
| 94 | PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) |
| 95 | PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) |
| 96 | PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` |
| 97 | FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) |
| 98 | |
| 99 | test-libperl: |
| 100 | $(BUILD) $(FLAGS_PERL_EMBED) |
| 101 | |
Ingo Molnar | 9734163 | 2013-09-30 15:18:37 +0200 | [diff] [blame] | 102 | override PYTHON := python |
| 103 | override PYTHON_CONFIG := python-config |
| 104 | |
| 105 | escape-for-shell-sq = $(subst ','\'',$(1)) |
| 106 | shell-sq = '$(escape-for-shell-sq)' |
| 107 | |
| 108 | PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG)) |
| 109 | |
| 110 | PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) |
| 111 | PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS)) |
| 112 | PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) |
| 113 | PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) |
| 114 | FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS) |
| 115 | |
| 116 | test-libpython: |
| 117 | $(BUILD) $(FLAGS_PYTHON_EMBED) |
| 118 | |
Ingo Molnar | 95d061c | 2013-09-30 15:40:04 +0200 | [diff] [blame] | 119 | test-libpython-version: |
| 120 | $(BUILD) $(FLAGS_PYTHON_EMBED) |
| 121 | |
Ingo Molnar | 3b7646e | 2013-09-30 15:53:31 +0200 | [diff] [blame] | 122 | test-libbfd: |
Ingo Molnar | 0dc0974 | 2013-10-10 08:47:01 +0200 | [diff] [blame] | 123 | $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl |
Ingo Molnar | 3b7646e | 2013-09-30 15:53:31 +0200 | [diff] [blame] | 124 | |
Ingo Molnar | 1c47661 | 2013-10-02 15:15:09 +0200 | [diff] [blame] | 125 | test-liberty: |
Ingo Molnar | 0dc0974 | 2013-10-10 08:47:01 +0200 | [diff] [blame] | 126 | $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty |
Ingo Molnar | 1c47661 | 2013-10-02 15:15:09 +0200 | [diff] [blame] | 127 | |
| 128 | test-liberty-z: |
Ingo Molnar | 0dc0974 | 2013-10-10 08:47:01 +0200 | [diff] [blame] | 129 | $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz |
Ingo Molnar | 1c47661 | 2013-10-02 15:15:09 +0200 | [diff] [blame] | 130 | |
| 131 | test-cplus-demangle: |
| 132 | $(BUILD) -liberty |
| 133 | |
Ingo Molnar | 34ef216 | 2013-09-30 16:46:49 +0200 | [diff] [blame] | 134 | test-on-exit: |
| 135 | $(BUILD) |
| 136 | |
Ingo Molnar | 4cc9117 | 2013-09-30 16:49:38 +0200 | [diff] [blame] | 137 | test-backtrace: |
| 138 | $(BUILD) |
| 139 | |
David Ahern | 87419c9 | 2013-10-29 10:43:16 -0600 | [diff] [blame] | 140 | test-timerfd: |
| 141 | $(BUILD) |
| 142 | |
Ingo Molnar | 231486a | 2013-10-10 09:10:59 +0200 | [diff] [blame] | 143 | -include *.d |
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 144 | |
Ingo Molnar | b6aa997 | 2013-09-30 10:08:24 +0200 | [diff] [blame] | 145 | ############################### |
| 146 | |
| 147 | clean: |
Ingo Molnar | 8b6eb56 | 2013-09-30 13:51:28 +0200 | [diff] [blame] | 148 | rm -f $(FILES) *.d |