2013-09-30 16:08:24 +08:00
|
|
|
|
2013-09-30 19:37:10 +08:00
|
|
|
FILES= \
|
2013-10-02 15:54:43 +08:00
|
|
|
test-all \
|
|
|
|
test-backtrace \
|
2013-09-30 20:11:46 +08:00
|
|
|
test-bionic \
|
2013-10-07 16:35:39 +08:00
|
|
|
test-dwarf \
|
2013-10-02 15:54:43 +08:00
|
|
|
test-fortify-source \
|
|
|
|
test-glibc \
|
2013-09-30 21:01:56 +08:00
|
|
|
test-gtk2 \
|
2013-09-30 21:08:30 +08:00
|
|
|
test-gtk2-infobar \
|
2013-10-02 15:54:43 +08:00
|
|
|
test-hello \
|
|
|
|
test-libaudit \
|
|
|
|
test-libbfd \
|
|
|
|
test-libelf \
|
|
|
|
test-libelf-getphdrnum \
|
|
|
|
test-libelf-mmap \
|
|
|
|
test-libnuma \
|
2013-09-30 21:15:36 +08:00
|
|
|
test-libperl \
|
2013-09-30 21:18:37 +08:00
|
|
|
test-libpython \
|
2013-09-30 21:40:04 +08:00
|
|
|
test-libpython-version \
|
2013-10-02 15:54:43 +08:00
|
|
|
test-libslang \
|
|
|
|
test-libunwind \
|
2013-09-30 22:46:49 +08:00
|
|
|
test-on-exit \
|
2013-10-02 15:54:43 +08:00
|
|
|
test-stackprotector-all \
|
|
|
|
test-stackprotector \
|
|
|
|
test-volatile-register-var
|
2013-09-30 16:08:24 +08:00
|
|
|
|
2013-09-30 19:51:28 +08:00
|
|
|
CC := $(CC) -MD
|
|
|
|
|
2013-09-30 16:08:24 +08:00
|
|
|
all: $(FILES)
|
|
|
|
|
|
|
|
BUILD = $(CC) -o $(OUTPUT)$@ $@.c
|
|
|
|
|
|
|
|
###############################
|
|
|
|
|
2013-10-01 20:14:31 +08:00
|
|
|
test-all:
|
|
|
|
$(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
|
|
|
|
|
2013-09-30 19:51:28 +08:00
|
|
|
test-hello:
|
2013-09-30 16:08:24 +08:00
|
|
|
$(BUILD)
|
|
|
|
|
2013-09-30 19:48:44 +08:00
|
|
|
test-stackprotector-all:
|
|
|
|
$(BUILD) -Werror -fstack-protector-all
|
|
|
|
|
2013-10-07 15:47:00 +08:00
|
|
|
test-stackprotector:
|
|
|
|
$(BUILD) -Werror -fstack-protector
|
|
|
|
|
2013-09-30 19:58:12 +08:00
|
|
|
test-volatile-register-var:
|
|
|
|
$(BUILD) -Werror -Wvolatile-register-var
|
|
|
|
|
2013-10-07 15:38:28 +08:00
|
|
|
test-fortify-source:
|
|
|
|
$(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
|
|
|
|
|
2013-09-30 20:11:46 +08:00
|
|
|
test-bionic:
|
|
|
|
$(BUILD)
|
|
|
|
|
2013-09-30 20:20:25 +08:00
|
|
|
test-libelf:
|
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2013-10-07 16:34:20 +08:00
|
|
|
test-glibc:
|
|
|
|
$(BUILD)
|
|
|
|
|
2013-10-07 16:35:39 +08:00
|
|
|
test-dwarf:
|
|
|
|
$(BUILD) -ldw
|
|
|
|
|
2013-09-30 21:02:28 +08:00
|
|
|
test-libelf-mmap:
|
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2013-09-30 20:35:27 +08:00
|
|
|
test-libelf-getphdrnum:
|
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2013-09-30 19:37:10 +08:00
|
|
|
test-libnuma:
|
|
|
|
$(BUILD) -lnuma
|
|
|
|
|
2013-09-30 20:45:44 +08:00
|
|
|
test-libunwind:
|
|
|
|
$(BUILD) -lunwind -lunwind-x86_64 -lelf
|
|
|
|
|
2013-09-30 20:55:31 +08:00
|
|
|
test-libaudit:
|
|
|
|
$(BUILD) -laudit
|
|
|
|
|
2013-09-30 20:57:54 +08:00
|
|
|
test-libslang:
|
|
|
|
$(BUILD) -I/usr/include/slang -lslang
|
|
|
|
|
2013-09-30 21:01:56 +08:00
|
|
|
test-gtk2:
|
|
|
|
$(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
|
|
|
|
|
2013-09-30 21:08:30 +08:00
|
|
|
test-gtk2-infobar:
|
|
|
|
$(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
|
|
|
|
|
2013-09-30 21:15:36 +08:00
|
|
|
grep-libs = $(filter -l%,$(1))
|
|
|
|
strip-libs = $(filter-out -l%,$(1))
|
|
|
|
|
|
|
|
PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
|
|
|
|
PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
|
|
|
|
PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
|
|
|
|
PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
|
|
|
|
FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
|
|
|
|
|
|
|
|
test-libperl:
|
|
|
|
$(BUILD) $(FLAGS_PERL_EMBED)
|
|
|
|
|
2013-09-30 21:18:37 +08:00
|
|
|
override PYTHON := python
|
|
|
|
override PYTHON_CONFIG := python-config
|
|
|
|
|
|
|
|
escape-for-shell-sq = $(subst ','\'',$(1))
|
|
|
|
shell-sq = '$(escape-for-shell-sq)'
|
|
|
|
|
|
|
|
PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
|
|
|
|
|
|
|
|
PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
|
|
|
|
PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
|
|
|
|
PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
|
|
|
|
PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
|
|
|
|
FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
|
|
|
|
|
|
|
|
test-libpython:
|
|
|
|
$(BUILD) $(FLAGS_PYTHON_EMBED)
|
|
|
|
|
2013-09-30 21:40:04 +08:00
|
|
|
test-libpython-version:
|
|
|
|
$(BUILD) $(FLAGS_PYTHON_EMBED)
|
|
|
|
|
2013-09-30 21:53:31 +08:00
|
|
|
test-libbfd:
|
|
|
|
$(BUILD) -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl
|
|
|
|
|
2013-09-30 22:46:49 +08:00
|
|
|
test-on-exit:
|
|
|
|
$(BUILD)
|
|
|
|
|
2013-09-30 22:49:38 +08:00
|
|
|
test-backtrace:
|
|
|
|
$(BUILD)
|
|
|
|
|
2013-09-30 19:51:28 +08:00
|
|
|
-include *.d */*.d
|
|
|
|
|
2013-09-30 16:08:24 +08:00
|
|
|
###############################
|
|
|
|
|
|
|
|
clean:
|
2013-09-30 19:51:28 +08:00
|
|
|
rm -f $(FILES) *.d
|