2013-09-30 16:08:24 +08:00
|
|
|
|
2013-09-30 19:37:10 +08:00
|
|
|
FILES= \
|
2013-12-21 13:48:11 +08:00
|
|
|
test-all.bin \
|
|
|
|
test-backtrace.bin \
|
|
|
|
test-bionic.bin \
|
|
|
|
test-dwarf.bin \
|
|
|
|
test-fortify-source.bin \
|
|
|
|
test-glibc.bin \
|
|
|
|
test-gtk2.bin \
|
|
|
|
test-gtk2-infobar.bin \
|
|
|
|
test-hello.bin \
|
|
|
|
test-libaudit.bin \
|
|
|
|
test-libbfd.bin \
|
|
|
|
test-liberty.bin \
|
|
|
|
test-liberty-z.bin \
|
|
|
|
test-cplus-demangle.bin \
|
|
|
|
test-libelf.bin \
|
|
|
|
test-libelf-getphdrnum.bin \
|
|
|
|
test-libelf-mmap.bin \
|
|
|
|
test-libnuma.bin \
|
|
|
|
test-libperl.bin \
|
|
|
|
test-libpython.bin \
|
|
|
|
test-libpython-version.bin \
|
|
|
|
test-libslang.bin \
|
|
|
|
test-libunwind.bin \
|
|
|
|
test-libunwind-debug-frame.bin \
|
|
|
|
test-stackprotector-all.bin \
|
2014-02-19 23:52:56 +08:00
|
|
|
test-timerfd.bin \
|
|
|
|
test-libdw-dwarf-unwind.bin
|
2013-09-30 16:08:24 +08:00
|
|
|
|
2014-01-15 18:44:08 +08:00
|
|
|
CC := $(CROSS_COMPILE)gcc -MD
|
|
|
|
PKG_CONFIG := $(CROSS_COMPILE)pkg-config
|
2013-09-30 19:51:28 +08:00
|
|
|
|
2013-09-30 16:08:24 +08:00
|
|
|
all: $(FILES)
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
BUILD = $(CC) $(CFLAGS) -o $(OUTPUT)$@ $(patsubst %.bin,%.c,$@) $(LDFLAGS)
|
2013-09-30 16:08:24 +08:00
|
|
|
|
|
|
|
###############################
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-all.bin:
|
2014-01-15 18:44:08 +08:00
|
|
|
$(BUILD) -Werror -fstack-protector-all -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -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
|
2013-10-01 20:14:31 +08:00
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-hello.bin:
|
2013-09-30 16:08:24 +08:00
|
|
|
$(BUILD)
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-stackprotector-all.bin:
|
2013-09-30 19:48:44 +08:00
|
|
|
$(BUILD) -Werror -fstack-protector-all
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-fortify-source.bin:
|
2013-10-07 15:38:28 +08:00
|
|
|
$(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-bionic.bin:
|
2013-09-30 20:11:46 +08:00
|
|
|
$(BUILD)
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libelf.bin:
|
2013-09-30 20:20:25 +08:00
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-glibc.bin:
|
2013-10-07 16:34:20 +08:00
|
|
|
$(BUILD)
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-dwarf.bin:
|
2013-10-07 16:35:39 +08:00
|
|
|
$(BUILD) -ldw
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libelf-mmap.bin:
|
2013-09-30 21:02:28 +08:00
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libelf-getphdrnum.bin:
|
2013-09-30 20:35:27 +08:00
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libnuma.bin:
|
2013-09-30 19:37:10 +08:00
|
|
|
$(BUILD) -lnuma
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libunwind.bin:
|
2013-12-10 20:24:04 +08:00
|
|
|
$(BUILD) -lelf
|
2013-09-30 20:45:44 +08:00
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libunwind-debug-frame.bin:
|
2013-12-10 20:24:04 +08:00
|
|
|
$(BUILD) -lelf
|
2013-11-14 15:25:24 +08:00
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libaudit.bin:
|
2013-09-30 20:55:31 +08:00
|
|
|
$(BUILD) -laudit
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libslang.bin:
|
2013-09-30 20:57:54 +08:00
|
|
|
$(BUILD) -I/usr/include/slang -lslang
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-gtk2.bin:
|
2014-01-15 18:44:08 +08:00
|
|
|
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
|
2013-09-30 21:01:56 +08:00
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-gtk2-infobar.bin:
|
2014-01-15 18:44:08 +08:00
|
|
|
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
|
2013-09-30 21:08:30 +08:00
|
|
|
|
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)
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libperl.bin:
|
2013-09-30 21:15:36 +08:00
|
|
|
$(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)
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libpython.bin:
|
2013-09-30 21:18:37 +08:00
|
|
|
$(BUILD) $(FLAGS_PYTHON_EMBED)
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libpython-version.bin:
|
2013-09-30 21:40:04 +08:00
|
|
|
$(BUILD) $(FLAGS_PYTHON_EMBED)
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-libbfd.bin:
|
2014-01-12 03:42:51 +08:00
|
|
|
$(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
|
2013-09-30 21:53:31 +08:00
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-liberty.bin:
|
2013-10-10 14:47:01 +08:00
|
|
|
$(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
|
2013-10-02 21:15:09 +08:00
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-liberty-z.bin:
|
2013-10-10 14:47:01 +08:00
|
|
|
$(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
|
2013-10-02 21:15:09 +08:00
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-cplus-demangle.bin:
|
2013-10-02 21:15:09 +08:00
|
|
|
$(BUILD) -liberty
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-backtrace.bin:
|
2013-09-30 22:49:38 +08:00
|
|
|
$(BUILD)
|
|
|
|
|
2013-12-21 13:48:11 +08:00
|
|
|
test-timerfd.bin:
|
2013-10-30 00:43:16 +08:00
|
|
|
$(BUILD)
|
|
|
|
|
2014-02-19 23:52:56 +08:00
|
|
|
test-libdw-dwarf-unwind.bin:
|
|
|
|
$(BUILD)
|
|
|
|
|
2013-10-10 15:10:59 +08:00
|
|
|
-include *.d
|
2013-09-30 19:51:28 +08:00
|
|
|
|
2013-09-30 16:08:24 +08:00
|
|
|
###############################
|
|
|
|
|
|
|
|
clean:
|
2013-09-30 19:51:28 +08:00
|
|
|
rm -f $(FILES) *.d
|