18 test-libelf-getphdrnum \
23 test-libpython-version \
27 test-stackprotector-all \
34 BUILD = $(CC) $(LDFLAGS) -o $(OUTPUT)$@ $@.c
36 ###############################
39 $(BUILD) -Werror -fstack-protector -fstack-protector-all -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"' -lbfd -ldl
44 test-stackprotector-all:
45 $(BUILD) -Werror -fstack-protector-all
48 $(BUILD) -Werror -fstack-protector -Wstack-protector
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"' -lbfd -ldl
125 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
128 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
141 ###############################