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