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