4 test-stackprotector-all \
6 test-volatile-register-var \
13 test-libelf-getphdrnum \
21 test-libpython-version \
31 BUILD = $(CC) -o $(OUTPUT)$@ $@.c
33 ###############################
36 $(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
41 test-stackprotector-all:
42 $(BUILD) -Werror -fstack-protector-all
45 $(BUILD) -Werror -fstack-protector
47 test-volatile-register-var:
48 $(BUILD) -Werror -Wvolatile-register-var
51 $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
68 test-libelf-getphdrnum:
75 $(BUILD) -lunwind -lunwind-x86_64 -lelf
81 $(BUILD) -I/usr/include/slang -lslang
84 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
87 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
89 grep-libs = $(filter -l%,$(1))
90 strip-libs = $(filter-out -l%,$(1))
92 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
93 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
94 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
95 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
96 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
99 $(BUILD) $(FLAGS_PERL_EMBED)
101 override PYTHON := python
102 override PYTHON_CONFIG := python-config
104 escape-for-shell-sq = $(subst ','\'',$(1))
105 shell-sq = '$(escape-for-shell-sq)'
107 PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
109 PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
110 PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
111 PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
112 PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
113 FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
116 $(BUILD) $(FLAGS_PYTHON_EMBED)
118 test-libpython-version:
119 $(BUILD) $(FLAGS_PYTHON_EMBED)
122 $(BUILD) -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl
132 ###############################