aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/Makefile
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-10-23 02:23:20 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-23 02:23:20 -0400
commit43315956509ca6913764861ac7dec128b91eb1ec (patch)
tree60fd5647f150a46e63093a41417c2eef3e776b3d /tools/perf/Makefile
parent9bf4e7fba8006d19846fec877b6da0616b2772de (diff)
parent6beba7adbe092e63dfe8d09fbd1e3ec140474a13 (diff)
Merge branch 'perf/core' into perf/probes
Conflicts: tools/perf/Makefile Merge reason: - fix the conflict - pick up the pr_*() infrastructure to queue up dependent patch Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r--tools/perf/Makefile58
1 files changed, 54 insertions, 4 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 1811a7015f9c..147e3cf035d3 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -201,7 +201,14 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
201EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes 201EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
202EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement 202EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement
203 203
204CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) 204ifeq ("$(origin DEBUG)", "command line")
205 PERF_DEBUG = $(DEBUG)
206endif
207ifndef PERF_DEBUG
208 CFLAGS_OPTIMIZE = -O6
209endif
210
211CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
205LDFLAGS = -lpthread -lrt -lelf -lm 212LDFLAGS = -lpthread -lrt -lelf -lm
206ALL_CFLAGS = $(CFLAGS) 213ALL_CFLAGS = $(CFLAGS)
207ALL_LDFLAGS = $(LDFLAGS) 214ALL_LDFLAGS = $(LDFLAGS)
@@ -329,8 +336,26 @@ LIB_H += ../../include/linux/perf_event.h
329LIB_H += ../../include/linux/rbtree.h 336LIB_H += ../../include/linux/rbtree.h
330LIB_H += ../../include/linux/list.h 337LIB_H += ../../include/linux/list.h
331LIB_H += ../../include/linux/stringify.h 338LIB_H += ../../include/linux/stringify.h
339LIB_H += util/include/linux/bitmap.h
340LIB_H += util/include/linux/bitops.h
341LIB_H += util/include/linux/compiler.h
342LIB_H += util/include/linux/ctype.h
343LIB_H += util/include/linux/kernel.h
332LIB_H += util/include/linux/list.h 344LIB_H += util/include/linux/list.h
345LIB_H += util/include/linux/module.h
346LIB_H += util/include/linux/poison.h
347LIB_H += util/include/linux/prefetch.h
348LIB_H += util/include/linux/rbtree.h
349LIB_H += util/include/linux/string.h
350LIB_H += util/include/linux/types.h
351LIB_H += util/include/asm/asm-offsets.h
352LIB_H += util/include/asm/bitops.h
353LIB_H += util/include/asm/byteorder.h
354LIB_H += util/include/asm/swab.h
355LIB_H += util/include/asm/system.h
356LIB_H += util/include/asm/uaccess.h
333LIB_H += perf.h 357LIB_H += perf.h
358LIB_H += util/event.h
334LIB_H += util/types.h 359LIB_H += util/types.h
335LIB_H += util/levenshtein.h 360LIB_H += util/levenshtein.h
336LIB_H += util/parse-options.h 361LIB_H += util/parse-options.h
@@ -344,9 +369,12 @@ LIB_H += util/strlist.h
344LIB_H += util/run-command.h 369LIB_H += util/run-command.h
345LIB_H += util/sigchain.h 370LIB_H += util/sigchain.h
346LIB_H += util/symbol.h 371LIB_H += util/symbol.h
347LIB_H += util/module.h
348LIB_H += util/color.h 372LIB_H += util/color.h
349LIB_H += util/values.h 373LIB_H += util/values.h
374LIB_H += util/sort.h
375LIB_H += util/hist.h
376LIB_H += util/thread.h
377LIB_H += util/data_map.h
350 378
351LIB_OBJS += util/abspath.o 379LIB_OBJS += util/abspath.o
352LIB_OBJS += util/alias.o 380LIB_OBJS += util/alias.o
@@ -360,6 +388,9 @@ LIB_OBJS += util/parse-options.o
360LIB_OBJS += util/parse-events.o 388LIB_OBJS += util/parse-events.o
361LIB_OBJS += util/path.o 389LIB_OBJS += util/path.o
362LIB_OBJS += util/rbtree.o 390LIB_OBJS += util/rbtree.o
391LIB_OBJS += util/bitmap.o
392LIB_OBJS += util/hweight.o
393LIB_OBJS += util/find_next_bit.o
363LIB_OBJS += util/run-command.o 394LIB_OBJS += util/run-command.o
364LIB_OBJS += util/quote.o 395LIB_OBJS += util/quote.o
365LIB_OBJS += util/strbuf.o 396LIB_OBJS += util/strbuf.o
@@ -369,7 +400,6 @@ LIB_OBJS += util/usage.o
369LIB_OBJS += util/wrapper.o 400LIB_OBJS += util/wrapper.o
370LIB_OBJS += util/sigchain.o 401LIB_OBJS += util/sigchain.o
371LIB_OBJS += util/symbol.o 402LIB_OBJS += util/symbol.o
372LIB_OBJS += util/module.o
373LIB_OBJS += util/color.o 403LIB_OBJS += util/color.o
374LIB_OBJS += util/pager.o 404LIB_OBJS += util/pager.o
375LIB_OBJS += util/header.o 405LIB_OBJS += util/header.o
@@ -382,6 +412,9 @@ LIB_OBJS += util/trace-event-parse.o
382LIB_OBJS += util/trace-event-read.o 412LIB_OBJS += util/trace-event-read.o
383LIB_OBJS += util/trace-event-info.o 413LIB_OBJS += util/trace-event-info.o
384LIB_OBJS += util/svghelper.o 414LIB_OBJS += util/svghelper.o
415LIB_OBJS += util/sort.o
416LIB_OBJS += util/hist.o
417LIB_OBJS += util/data_map.o
385 418
386BUILTIN_OBJS += builtin-annotate.o 419BUILTIN_OBJS += builtin-annotate.o
387BUILTIN_OBJS += builtin-help.o 420BUILTIN_OBJS += builtin-help.o
@@ -424,8 +457,12 @@ ifeq ($(uname_S),Darwin)
424 PTHREAD_LIBS = 457 PTHREAD_LIBS =
425endif 458endif
426 459
460ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
461 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
462endif
463
427ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) 464ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
428 msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); 465 msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel);
429endif 466endif
430 467
431ifneq ($(shell sh -c "(echo '\#include <libdwarf/dwarf.h>'; echo '\#include <libdwarf/libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) 468ifneq ($(shell sh -c "(echo '\#include <libdwarf/dwarf.h>'; echo '\#include <libdwarf/libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
@@ -795,6 +832,19 @@ util/config.o: util/config.c PERF-CFLAGS
795util/rbtree.o: ../../lib/rbtree.c PERF-CFLAGS 832util/rbtree.o: ../../lib/rbtree.c PERF-CFLAGS
796 $(QUIET_CC)$(CC) -o util/rbtree.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 833 $(QUIET_CC)$(CC) -o util/rbtree.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
797 834
835# some perf warning policies can't fit to lib/bitmap.c, eg: it warns about variable shadowing
836# from <string.h> that comes from kernel headers wrapping.
837KBITMAP_FLAGS=`echo $(ALL_CFLAGS) | sed s/-Wshadow// | sed s/-Wswitch-default// | sed s/-Wextra//`
838
839util/bitmap.o: ../../lib/bitmap.c PERF-CFLAGS
840 $(QUIET_CC)$(CC) -o util/bitmap.o -c $(KBITMAP_FLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
841
842util/hweight.o: ../../lib/hweight.c PERF-CFLAGS
843 $(QUIET_CC)$(CC) -o util/hweight.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
844
845util/find_next_bit.o: ../../lib/find_next_bit.c PERF-CFLAGS
846 $(QUIET_CC)$(CC) -o util/find_next_bit.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
847
798perf-%$X: %.o $(PERFLIBS) 848perf-%$X: %.o $(PERFLIBS)
799 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) 849 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
800 850