Commit | Line | Data |
---|---|---|
b6aa9979 | 1 | |
3ae069cf IM |
2 | FILES= \ |
3 | test-hello \ | |
90ac5422 | 4 | test-stackprotector-all \ |
430be5ab | 5 | test-stackprotector \ |
c2510445 | 6 | test-volatile-register-var \ |
1ea6f99e | 7 | test-fortify-source \ |
78e9d655 | 8 | test-bionic \ |
8f7f8005 | 9 | test-libelf \ |
e12762cf | 10 | test-glibc \ |
8295d4e2 | 11 | test-dwarf \ |
8869b17e | 12 | test-libelf-mmap \ |
b7bcef6f | 13 | test-libelf-getphdrnum \ |
058f952d | 14 | test-libunwind \ |
d795a658 | 15 | test-libaudit \ |
b9498b50 | 16 | test-libslang \ |
7ef9e055 | 17 | test-gtk2 \ |
c7a79e96 | 18 | test-gtk2-infobar \ |
7181a671 | 19 | test-libperl \ |
9734163b | 20 | test-libpython \ |
95d061c8 | 21 | test-libpython-version \ |
3ae069cf | 22 | test-libnuma |
b6aa9979 | 23 | |
8b6eb56a IM |
24 | CC := $(CC) -MD |
25 | ||
b6aa9979 IM |
26 | all: $(FILES) |
27 | ||
28 | BUILD = $(CC) -o $(OUTPUT)$@ $@.c | |
29 | ||
30 | ############################### | |
31 | ||
8b6eb56a | 32 | test-hello: |
b6aa9979 IM |
33 | $(BUILD) |
34 | ||
90ac5422 IM |
35 | test-stackprotector-all: |
36 | $(BUILD) -Werror -fstack-protector-all | |
37 | ||
430be5ab IM |
38 | test-stackprotector: |
39 | $(BUILD) -Werror -fstack-protector | |
40 | ||
c2510445 IM |
41 | test-volatile-register-var: |
42 | $(BUILD) -Werror -Wvolatile-register-var | |
43 | ||
1ea6f99e IM |
44 | test-fortify-source: |
45 | $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2 | |
46 | ||
78e9d655 IM |
47 | test-bionic: |
48 | $(BUILD) | |
49 | ||
8f7f8005 IM |
50 | test-libelf: |
51 | $(BUILD) -lelf | |
52 | ||
e12762cf IM |
53 | test-glibc: |
54 | $(BUILD) | |
55 | ||
8295d4e2 IM |
56 | test-dwarf: |
57 | $(BUILD) -ldw | |
58 | ||
8869b17e IM |
59 | test-libelf-mmap: |
60 | $(BUILD) -lelf | |
61 | ||
b7bcef6f IM |
62 | test-libelf-getphdrnum: |
63 | $(BUILD) -lelf | |
64 | ||
3ae069cf IM |
65 | test-libnuma: |
66 | $(BUILD) -lnuma | |
67 | ||
058f952d IM |
68 | test-libunwind: |
69 | $(BUILD) -lunwind -lunwind-x86_64 -lelf | |
70 | ||
d795a658 IM |
71 | test-libaudit: |
72 | $(BUILD) -laudit | |
73 | ||
b9498b50 IM |
74 | test-libslang: |
75 | $(BUILD) -I/usr/include/slang -lslang | |
76 | ||
7ef9e055 IM |
77 | test-gtk2: |
78 | $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) | |
79 | ||
c7a79e96 IM |
80 | test-gtk2-infobar: |
81 | $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) | |
82 | ||
7181a671 IM |
83 | grep-libs = $(filter -l%,$(1)) |
84 | strip-libs = $(filter-out -l%,$(1)) | |
85 | ||
86 | PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) | |
87 | PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) | |
88 | PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) | |
89 | PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` | |
90 | FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) | |
91 | ||
92 | test-libperl: | |
93 | $(BUILD) $(FLAGS_PERL_EMBED) | |
94 | ||
9734163b IM |
95 | override PYTHON := python |
96 | override PYTHON_CONFIG := python-config | |
97 | ||
98 | escape-for-shell-sq = $(subst ','\'',$(1)) | |
99 | shell-sq = '$(escape-for-shell-sq)' | |
100 | ||
101 | PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG)) | |
102 | ||
103 | PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) | |
104 | PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS)) | |
105 | PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) | |
106 | PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) | |
107 | FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS) | |
108 | ||
109 | test-libpython: | |
110 | $(BUILD) $(FLAGS_PYTHON_EMBED) | |
111 | ||
95d061c8 IM |
112 | test-libpython-version: |
113 | $(BUILD) $(FLAGS_PYTHON_EMBED) | |
114 | ||
8b6eb56a IM |
115 | -include *.d */*.d |
116 | ||
b6aa9979 IM |
117 | ############################### |
118 | ||
119 | clean: | |
8b6eb56a | 120 | rm -f $(FILES) *.d |