2013-09-30 15:08:24 +07:00
|
|
|
|
2013-09-30 18:37:10 +07:00
|
|
|
FILES= \
|
|
|
|
test-hello \
|
2013-09-30 18:48:44 +07:00
|
|
|
test-stackprotector-all \
|
2013-10-07 14:47:00 +07:00
|
|
|
test-stackprotector \
|
2013-09-30 18:58:12 +07:00
|
|
|
test-volatile-register-var \
|
2013-10-07 14:38:28 +07:00
|
|
|
test-fortify-source \
|
2013-09-30 19:11:46 +07:00
|
|
|
test-bionic \
|
2013-09-30 19:20:25 +07:00
|
|
|
test-libelf \
|
2013-10-07 15:34:20 +07:00
|
|
|
test-glibc \
|
2013-10-07 15:35:39 +07:00
|
|
|
test-dwarf \
|
2013-09-30 20:02:28 +07:00
|
|
|
test-libelf-mmap \
|
2013-09-30 19:35:27 +07:00
|
|
|
test-libelf-getphdrnum \
|
2013-09-30 19:45:44 +07:00
|
|
|
test-libunwind \
|
2013-09-30 19:55:31 +07:00
|
|
|
test-libaudit \
|
2013-09-30 19:57:54 +07:00
|
|
|
test-libslang \
|
2013-09-30 20:01:56 +07:00
|
|
|
test-gtk2 \
|
2013-09-30 20:08:30 +07:00
|
|
|
test-gtk2-infobar \
|
2013-09-30 20:15:36 +07:00
|
|
|
test-libperl \
|
2013-09-30 20:18:37 +07:00
|
|
|
test-libpython \
|
2013-09-30 20:40:04 +07:00
|
|
|
test-libpython-version \
|
2013-10-08 15:10:45 +07:00
|
|
|
test-strlcpy \
|
2013-09-30 20:53:31 +07:00
|
|
|
test-libbfd \
|
2013-09-30 18:37:10 +07:00
|
|
|
test-libnuma
|
2013-09-30 15:08:24 +07:00
|
|
|
|
2013-09-30 18:51:28 +07:00
|
|
|
CC := $(CC) -MD
|
|
|
|
|
2013-09-30 15:08:24 +07:00
|
|
|
all: $(FILES)
|
|
|
|
|
|
|
|
BUILD = $(CC) -o $(OUTPUT)$@ $@.c
|
|
|
|
|
|
|
|
###############################
|
|
|
|
|
2013-09-30 18:51:28 +07:00
|
|
|
test-hello:
|
2013-09-30 15:08:24 +07:00
|
|
|
$(BUILD)
|
|
|
|
|
2013-09-30 18:48:44 +07:00
|
|
|
test-stackprotector-all:
|
|
|
|
$(BUILD) -Werror -fstack-protector-all
|
|
|
|
|
2013-10-07 14:47:00 +07:00
|
|
|
test-stackprotector:
|
|
|
|
$(BUILD) -Werror -fstack-protector
|
|
|
|
|
2013-09-30 18:58:12 +07:00
|
|
|
test-volatile-register-var:
|
|
|
|
$(BUILD) -Werror -Wvolatile-register-var
|
|
|
|
|
2013-10-07 14:38:28 +07:00
|
|
|
test-fortify-source:
|
|
|
|
$(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
|
|
|
|
|
2013-09-30 19:11:46 +07:00
|
|
|
test-bionic:
|
|
|
|
$(BUILD)
|
|
|
|
|
2013-09-30 19:20:25 +07:00
|
|
|
test-libelf:
|
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2013-10-07 15:34:20 +07:00
|
|
|
test-glibc:
|
|
|
|
$(BUILD)
|
|
|
|
|
2013-10-07 15:35:39 +07:00
|
|
|
test-dwarf:
|
|
|
|
$(BUILD) -ldw
|
|
|
|
|
2013-09-30 20:02:28 +07:00
|
|
|
test-libelf-mmap:
|
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2013-09-30 19:35:27 +07:00
|
|
|
test-libelf-getphdrnum:
|
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2013-09-30 18:37:10 +07:00
|
|
|
test-libnuma:
|
|
|
|
$(BUILD) -lnuma
|
|
|
|
|
2013-09-30 19:45:44 +07:00
|
|
|
test-libunwind:
|
|
|
|
$(BUILD) -lunwind -lunwind-x86_64 -lelf
|
|
|
|
|
2013-09-30 19:55:31 +07:00
|
|
|
test-libaudit:
|
|
|
|
$(BUILD) -laudit
|
|
|
|
|
2013-09-30 19:57:54 +07:00
|
|
|
test-libslang:
|
|
|
|
$(BUILD) -I/usr/include/slang -lslang
|
|
|
|
|
2013-09-30 20:01:56 +07:00
|
|
|
test-gtk2:
|
|
|
|
$(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
|
|
|
|
|
2013-09-30 20:08:30 +07:00
|
|
|
test-gtk2-infobar:
|
|
|
|
$(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
test-libperl:
|
|
|
|
$(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)
|
|
|
|
|
|
|
|
test-libpython:
|
|
|
|
$(BUILD) $(FLAGS_PYTHON_EMBED)
|
|
|
|
|
2013-09-30 20:40:04 +07:00
|
|
|
test-libpython-version:
|
|
|
|
$(BUILD) $(FLAGS_PYTHON_EMBED)
|
|
|
|
|
2013-10-08 15:10:45 +07:00
|
|
|
test-strlcpy:
|
|
|
|
$(BUILD)
|
|
|
|
|
2013-09-30 20:53:31 +07:00
|
|
|
test-libbfd:
|
|
|
|
$(BUILD) -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl
|
|
|
|
|
2013-09-30 18:51:28 +07:00
|
|
|
-include *.d */*.d
|
|
|
|
|
2013-09-30 15:08:24 +07:00
|
|
|
###############################
|
|
|
|
|
|
|
|
clean:
|
2013-09-30 18:51:28 +07:00
|
|
|
rm -f $(FILES) *.d
|