15 test-libelf-getphdrnum \
20 test-libpython-version \
24 test-stackprotector-all \
26 test-volatile-register-var
32 BUILD = $(CC) -o $(OUTPUT)$@ $@.c
34 ###############################
37 $(BUILD) -Werror -fstack-protector -fstack-protector-all -Wvolatile-register-var -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lunwind -lunwind-x86_64 -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' -DPACKAGE=perf -lbfd -ldl
42 test-stackprotector-all:
43 $(BUILD) -Werror -fstack-protector-all
46 $(BUILD) -Werror -fstack-protector
48 test-volatile-register-var:
49 $(BUILD) -Werror -Wvolatile-register-var
52 $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
69 test-libelf-getphdrnum:
76 $(BUILD) -lunwind -lunwind-x86_64 -lelf
82 $(BUILD) -I/usr/include/slang -lslang
85 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
88 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
90 grep-libs = $(filter -l%,$(1))
91 strip-libs = $(filter-out -l%,$(1))
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)
100 $(BUILD) $(FLAGS_PERL_EMBED)
102 override PYTHON := python
103 override PYTHON_CONFIG := python-config
105 escape-for-shell-sq = $(subst ','\'',$(1))
106 shell-sq = '$(escape-for-shell-sq)'
108 PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
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)
117 $(BUILD) $(FLAGS_PYTHON_EMBED)
119 test-libpython-version:
120 $(BUILD) $(FLAGS_PYTHON_EMBED)
123 $(BUILD) -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl
133 ###############################