18 test-libelf-getphdrnum \
23 test-libpython-version \
27 test-stackprotector-all \
29 test-volatile-register-var
35 BUILD = $(CC) $(LDFLAGS) -o $(OUTPUT)$@ $@.c
37 ###############################
40 $(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
45 test-stackprotector-all:
46 $(BUILD) -Werror -fstack-protector-all
49 $(BUILD) -Werror -fstack-protector
51 test-volatile-register-var:
52 $(BUILD) -Werror -Wvolatile-register-var
55 $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
72 test-libelf-getphdrnum:
79 $(BUILD) -lunwind -lunwind-x86_64 -lelf
85 $(BUILD) -I/usr/include/slang -lslang
88 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
91 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
93 grep-libs = $(filter -l%,$(1))
94 strip-libs = $(filter-out -l%,$(1))
96 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
97 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
98 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
99 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
100 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
103 $(BUILD) $(FLAGS_PERL_EMBED)
105 override PYTHON := python
106 override PYTHON_CONFIG := python-config
108 escape-for-shell-sq = $(subst ','\'',$(1))
109 shell-sq = '$(escape-for-shell-sq)'
111 PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
113 PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
114 PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
115 PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
116 PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
117 FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
120 $(BUILD) $(FLAGS_PYTHON_EMBED)
122 test-libpython-version:
123 $(BUILD) $(FLAGS_PYTHON_EMBED)
126 $(BUILD) -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl
129 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl -liberty
132 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl -liberty -lz
145 ###############################