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