blob: 3033c25f00b4b5833b5d3cf02348d38cd4ea4333 [file] [log] [blame]
Ingo Molnarb6aa9972013-09-30 10:08:24 +02001
Ingo Molnar3ae069c2013-09-30 13:37:10 +02002FILES= \
3 test-hello \
Ingo Molnar90ac5422013-09-30 13:48:44 +02004 test-stackprotector-all \
Ingo Molnar430be5a2013-10-07 09:47:00 +02005 test-stackprotector \
Ingo Molnarc2510442013-09-30 13:58:12 +02006 test-volatile-register-var \
Ingo Molnar1ea6f992013-10-07 09:38:28 +02007 test-fortify-source \
Ingo Molnar78e9d652013-09-30 14:11:46 +02008 test-bionic \
Ingo Molnar8f7f8002013-09-30 14:20:25 +02009 test-libelf \
Ingo Molnare12762c2013-10-07 10:34:20 +020010 test-glibc \
Ingo Molnar8295d4e2013-10-07 10:35:39 +020011 test-dwarf \
Ingo Molnar8869b172013-09-30 15:02:28 +020012 test-libelf-mmap \
Ingo Molnarb7bcef62013-09-30 14:35:27 +020013 test-libelf-getphdrnum \
Ingo Molnar058f9522013-09-30 14:45:44 +020014 test-libunwind \
Ingo Molnard795a652013-09-30 14:55:31 +020015 test-libaudit \
Ingo Molnarb9498b52013-09-30 14:57:54 +020016 test-libslang \
Ingo Molnar7ef9e052013-09-30 15:01:56 +020017 test-gtk2 \
Ingo Molnarc7a79e92013-09-30 15:08:30 +020018 test-gtk2-infobar \
Ingo Molnar7181a672013-09-30 15:15:36 +020019 test-libperl \
Ingo Molnar3ae069c2013-09-30 13:37:10 +020020 test-libnuma
Ingo Molnarb6aa9972013-09-30 10:08:24 +020021
Ingo Molnar8b6eb562013-09-30 13:51:28 +020022CC := $(CC) -MD
23
Ingo Molnarb6aa9972013-09-30 10:08:24 +020024all: $(FILES)
25
26BUILD = $(CC) -o $(OUTPUT)$@ $@.c
27
28###############################
29
Ingo Molnar8b6eb562013-09-30 13:51:28 +020030test-hello:
Ingo Molnarb6aa9972013-09-30 10:08:24 +020031 $(BUILD)
32
Ingo Molnar90ac5422013-09-30 13:48:44 +020033test-stackprotector-all:
34 $(BUILD) -Werror -fstack-protector-all
35
Ingo Molnar430be5a2013-10-07 09:47:00 +020036test-stackprotector:
37 $(BUILD) -Werror -fstack-protector
38
Ingo Molnarc2510442013-09-30 13:58:12 +020039test-volatile-register-var:
40 $(BUILD) -Werror -Wvolatile-register-var
41
Ingo Molnar1ea6f992013-10-07 09:38:28 +020042test-fortify-source:
43 $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
44
Ingo Molnar78e9d652013-09-30 14:11:46 +020045test-bionic:
46 $(BUILD)
47
Ingo Molnar8f7f8002013-09-30 14:20:25 +020048test-libelf:
49 $(BUILD) -lelf
50
Ingo Molnare12762c2013-10-07 10:34:20 +020051test-glibc:
52 $(BUILD)
53
Ingo Molnar8295d4e2013-10-07 10:35:39 +020054test-dwarf:
55 $(BUILD) -ldw
56
Ingo Molnar8869b172013-09-30 15:02:28 +020057test-libelf-mmap:
58 $(BUILD) -lelf
59
Ingo Molnarb7bcef62013-09-30 14:35:27 +020060test-libelf-getphdrnum:
61 $(BUILD) -lelf
62
Ingo Molnar3ae069c2013-09-30 13:37:10 +020063test-libnuma:
64 $(BUILD) -lnuma
65
Ingo Molnar058f9522013-09-30 14:45:44 +020066test-libunwind:
67 $(BUILD) -lunwind -lunwind-x86_64 -lelf
68
Ingo Molnard795a652013-09-30 14:55:31 +020069test-libaudit:
70 $(BUILD) -laudit
71
Ingo Molnarb9498b52013-09-30 14:57:54 +020072test-libslang:
73 $(BUILD) -I/usr/include/slang -lslang
74
Ingo Molnar7ef9e052013-09-30 15:01:56 +020075test-gtk2:
76 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
77
Ingo Molnarc7a79e92013-09-30 15:08:30 +020078test-gtk2-infobar:
79 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
80
Ingo Molnar7181a672013-09-30 15:15:36 +020081grep-libs = $(filter -l%,$(1))
82strip-libs = $(filter-out -l%,$(1))
83
84PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
85PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
86PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
87PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
88FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
89
90test-libperl:
91 $(BUILD) $(FLAGS_PERL_EMBED)
92
Ingo Molnar8b6eb562013-09-30 13:51:28 +020093-include *.d */*.d
94
Ingo Molnarb6aa9972013-09-30 10:08:24 +020095###############################
96
97clean:
Ingo Molnar8b6eb562013-09-30 13:51:28 +020098 rm -f $(FILES) *.d