@ -14,103 +14,23 @@ endif
# Define V=1 to have a more verbose compile.
# Define V=2 to have an even more verbose compile.
#
# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
# or vsnprintf() return -1 instead of number of characters which would
# have been written to the final string if enough space had been available.
#
# Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
# when attempting to read from an fopen'ed directory.
#
# Define CURLDIR=/foo/bar if your curl header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
# Define EXPATDIR=/foo/bar if your expat header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
#
# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
#
# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
# do not support the 'size specifiers' introduced by C99, namely ll, hh,
# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
# some C compilers supported these specifiers prior to C99 as an extension.
#
# Define NO_STRCASESTR if you don't have strcasestr.
#
# Define NO_MEMMEM if you don't have memmem.
#
# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
# If your compiler also does not support long long or does not have
# strtoull, define NO_STRTOULL.
#
# Define NO_SETENV if you don't have setenv in the C library.
#
# Define NO_UNSETENV if you don't have unsetenv in the C library.
#
# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
#
# Define NO_SYS_SELECT_H if you don't have sys/select.h.
#
# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink
# installed in /sw, but don't want PERF to link against any libraries
# installed there. If defined you may specify your own (or Fink's)
# include directories and library directories by defining CFLAGS
# and LDFLAGS appropriately.
#
# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
# have DarwinPorts installed in /opt/local, but don't want PERF to
# link against any libraries installed there. If defined you may
# specify your own (or DarwinPort's) include directories and
# library directories by defining CFLAGS and LDFLAGS appropriately.
#
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
#
# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
# Patrick Mauritz).
#
# Define NO_MMAP if you want to avoid mmap.
#
# Define NO_PTHREADS if you do not have or do not want to use Pthreads.
#
# Define NO_PREAD if you have a problem with pread() system call (e.g.
# cygwin.dll before v1.5.22).
#
# Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
# the executable mode bit, but doesn't really do so.
#
# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
#
# Define NO_SOCKADDR_STORAGE if your platform does not have struct
# sockaddr_storage.
#
# Define NO_ICONV if your libc does not properly support iconv.
#
# Define OLD_ICONV if your library has an old iconv(), where the second
# (input buffer pointer) parameter is declared with type (const char **).
#
# Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.
#
# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib"
# that tells runtime paths to dynamic libraries;
# "-Wl,-rpath=/path/lib" is used instead.
#
# Define USE_NSEC below if you want perf to care about sub-second file mtimes
# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
# randomly break unless your underlying filesystem supports those sub-second
# times (my ext3 doesn't).
#
# Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
# "st_ctim"
#
# Define NO_NSEC if your "struct stat" does not have "st_ctim.tv_nsec"
# available. This automatically turns USE_NSEC off.
#
# Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks
# field that counts the on-disk footprint in 512-byte blocks.
#
# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
#
# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
@ -282,8 +202,6 @@ BASIC_LDFLAGS =
# Guard against environment variables
BUILTIN_OBJS =
BUILT_INS =
COMPAT_CFLAGS =
COMPAT_OBJS =
LIB_H =
LIB_OBJS =
PYRF_OBJS =
@ -329,7 +247,7 @@ LANG_BINDINGS =
ALL_PROGRAMS = $( PROGRAMS) $( SCRIPTS)
# what 'all' will build but not install in perfexecdir
OTHER_PROGRAMS = $( OUTPUT) perf$X
OTHER_PROGRAMS = $( OUTPUT) perf
# Set paths to tools early so that they can be used for version tests.
i f n d e f S H E L L _ P A T H
@ -538,22 +456,6 @@ endif # NO_DWARF
- i n c l u d e a r c h / $( ARCH ) / M a k e f i l e
i f e q ( $( uname_S ) , D a r w i n )
ifndef NO_FINK
ifeq ( $( shell test -d /sw/lib && echo y) ,y)
BASIC_CFLAGS += -I/sw/include
BASIC_LDFLAGS += -L/sw/lib
endif
endif
ifndef NO_DARWIN_PORTS
ifeq ( $( shell test -d /opt/local/lib && echo y) ,y)
BASIC_CFLAGS += -I/opt/local/include
BASIC_LDFLAGS += -L/opt/local/lib
endif
endif
PTHREAD_LIBS =
e n d i f
i f n e q ( $( OUTPUT ) , )
BASIC_CFLAGS += -I$( OUTPUT)
e n d i f
@ -707,110 +609,9 @@ ifndef CC_LD_DYNPATH
endif
e n d i f
i f d e f N E E D S _ S O C K E T
EXTLIBS += -lsocket
e n d i f
i f d e f N E E D S _ N S L
EXTLIBS += -lnsl
e n d i f
i f d e f N O _ D _ T Y P E _ I N _ D I R E N T
BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT
e n d i f
i f d e f N O _ D _ I N O _ I N _ D I R E N T
BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
e n d i f
i f d e f N O _ S T _ B L O C K S _ I N _ S T R U C T _ S T A T
BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
e n d i f
i f d e f U S E _ N S E C
BASIC_CFLAGS += -DUSE_NSEC
e n d i f
i f d e f U S E _ S T _ T I M E S P E C
BASIC_CFLAGS += -DUSE_ST_TIMESPEC
e n d i f
i f d e f N O _ N S E C
BASIC_CFLAGS += -DNO_NSEC
e n d i f
i f d e f N O _ C 9 9 _ F O R M A T
BASIC_CFLAGS += -DNO_C99_FORMAT
e n d i f
i f d e f S N P R I N T F _ R E T U R N S _ B O G U S
COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS
COMPAT_OBJS += $( OUTPUT) compat/snprintf.o
e n d i f
i f d e f F R E A D _ R E A D S _ D I R E C T O R I E S
COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES
COMPAT_OBJS += $( OUTPUT) compat/fopen.o
e n d i f
i f d e f N O _ S T R C A S E S T R
COMPAT_CFLAGS += -DNO_STRCASESTR
COMPAT_OBJS += $( OUTPUT) compat/strcasestr.o
e n d i f
i f d e f N O _ S T R T O U M A X
COMPAT_CFLAGS += -DNO_STRTOUMAX
COMPAT_OBJS += $( OUTPUT) compat/strtoumax.o
e n d i f
i f d e f N O _ S T R T O U L L
COMPAT_CFLAGS += -DNO_STRTOULL
e n d i f
i f d e f N O _ S E T E N V
COMPAT_CFLAGS += -DNO_SETENV
COMPAT_OBJS += $( OUTPUT) compat/setenv.o
e n d i f
i f d e f N O _ M K D T E M P
COMPAT_CFLAGS += -DNO_MKDTEMP
COMPAT_OBJS += $( OUTPUT) compat/mkdtemp.o
e n d i f
i f d e f N O _ U N S E T E N V
COMPAT_CFLAGS += -DNO_UNSETENV
COMPAT_OBJS += $( OUTPUT) compat/unsetenv.o
e n d i f
i f d e f N O _ S Y S _ S E L E C T _ H
BASIC_CFLAGS += -DNO_SYS_SELECT_H
e n d i f
i f d e f N O _ M M A P
COMPAT_CFLAGS += -DNO_MMAP
COMPAT_OBJS += $( OUTPUT) compat/mmap.o
e l s e
ifdef USE_WIN32_MMAP
COMPAT_CFLAGS += -DUSE_WIN32_MMAP
COMPAT_OBJS += $( OUTPUT) compat/win32mmap.o
endif
e n d i f
i f d e f N O _ P R E A D
COMPAT_CFLAGS += -DNO_PREAD
COMPAT_OBJS += $( OUTPUT) compat/pread.o
e n d i f
i f d e f N O _ T R U S T A B L E _ F I L E M O D E
BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE
e n d i f
i f d e f N O _ I P V 6
BASIC_CFLAGS += -DNO_IPV6
e n d i f
i f d e f N O _ U I N T M A X _ T
BASIC_CFLAGS += -Duintmax_t= uint32_t
e n d i f
i f d e f N O _ S O C K A D D R _ S T O R A G E
i f d e f N O _ I P V 6
BASIC_CFLAGS += -Dsockaddr_storage= sockaddr_in
e l s e
BASIC_CFLAGS += -Dsockaddr_storage= sockaddr_in6
e n d i f
e n d i f
i f d e f N O _ I N E T _ N T O P
LIB_OBJS += $( OUTPUT) compat/inet_ntop.o
e n d i f
i f d e f N O _ I N E T _ P T O N
LIB_OBJS += $( OUTPUT) compat/inet_pton.o
e n d i f
i f d e f N O _ I C O N V
BASIC_CFLAGS += -DNO_ICONV
e n d i f
i f d e f O L D _ I C O N V
BASIC_CFLAGS += -DOLD_ICONV
e n d i f
i f d e f N O _ D E F L A T E _ B O U N D
BASIC_CFLAGS += -DNO_DEFLATE_BOUND
@ -819,14 +620,6 @@ endif
i f d e f N O _ P E R L _ M A K E M A K E R
export NO_PERL_MAKEMAKER
e n d i f
i f d e f N O _ H S T R E R R O R
COMPAT_CFLAGS += -DNO_HSTRERROR
COMPAT_OBJS += $( OUTPUT) compat/hstrerror.o
e n d i f
i f d e f N O _ M E M M E M
COMPAT_CFLAGS += -DNO_MEMMEM
COMPAT_OBJS += $( OUTPUT) compat/memmem.o
e n d i f
i f d e f I N T E R N A L _ Q S O R T
COMPAT_CFLAGS += -DINTERNAL_QSORT
COMPAT_OBJS += $( OUTPUT) compat/qsort.o
@ -835,9 +628,6 @@ ifdef RUNTIME_PREFIX
COMPAT_CFLAGS += -DRUNTIME_PREFIX
e n d i f
i f d e f D I R _ H A S _ B S D _ G R O U P _ S E M A N T I C S
COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS
e n d i f
i f d e f N O _ E X T E R N A L _ G R E P
BASIC_CFLAGS += -DNO_EXTERNAL_GREP
e n d i f
@ -895,9 +685,6 @@ PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
LIBS = -Wl,--whole-archive $( PERFLIBS) -Wl,--no-whole-archive $( EXTLIBS)
BASIC_CFLAGS += $( COMPAT_CFLAGS)
LIB_OBJS += $( COMPAT_OBJS)
ALL_CFLAGS += $( BASIC_CFLAGS)
ALL_CFLAGS += $( ARCH_CFLAGS)
ALL_LDFLAGS += $( BASIC_LDFLAGS)
@ -910,9 +697,6 @@ export TAR INSTALL DESTDIR SHELL_PATH
SHELL = $( SHELL_PATH)
all :: shell_compatibility_test $( ALL_PROGRAMS ) $( LANG_BINDINGS ) $( BUILT_INS ) $( OTHER_PROGRAMS ) $( OUTPUT ) PERF -BUILD -OPTIONS
i f n e q ( , $ X )
$( foreach p,$( patsubst %$X ,%,$( filter %$X ,$( ALL_PROGRAMS) $( BUILT_INS) perf$X ) ) , test '$p' -ef '$p$X' || $( RM) '$p' ; )
e n d i f
all ::
@ -921,15 +705,15 @@ please_set_SHELL_PATH_to_a_more_modern_shell:
shell_compatibility_test : please_set_SHELL_PATH_to_a_more_modern_shell
strip : $( PROGRAMS ) $( OUTPUT ) perf $X
$( STRIP) $( STRIP_OPTS) $( PROGRAMS) $( OUTPUT) perf$X
strip : $( PROGRAMS ) $( OUTPUT ) perf
$( STRIP) $( STRIP_OPTS) $( PROGRAMS) $( OUTPUT) perf
$(OUTPUT)perf.o : perf .c $( OUTPUT ) common -cmds .h $( OUTPUT ) PERF -CFLAGS
$( QUIET_CC) $( CC) -DPERF_VERSION= '"$(PERF_VERSION)"' \
'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
$( ALL_CFLAGS) -c $( filter %.c,$^) -o $@
$(OUTPUT)perf$X : $( OUTPUT ) perf .o $( BUILTIN_OBJS ) $( PERFLIBS )
$(OUTPUT)perf : $( OUTPUT ) perf .o $( BUILTIN_OBJS ) $( PERFLIBS )
$( QUIET_LINK) $( CC) $( ALL_CFLAGS) $( ALL_LDFLAGS) $( OUTPUT) perf.o \
$( BUILTIN_OBJS) $( LIBS) -o $@
@ -1027,11 +811,11 @@ $(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/tra
$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o : scripts /python /Perf -Trace -Util /Context .c $( OUTPUT ) PERF -CFLAGS
$( QUIET_CC) $( CC) -o $@ -c $( ALL_CFLAGS) $( PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
$(OUTPUT)perf-%$X : %.o $( PERFLIBS )
$(OUTPUT)perf-% : %.o $( PERFLIBS )
$( QUIET_LINK) $( CC) $( ALL_CFLAGS) -o $@ $( ALL_LDFLAGS) $( filter %.o,$^) $( LIBS)
$(LIB_OBJS) $(BUILTIN_OBJS) : $( LIB_H )
$(patsubst perf-%$X ,%.o,$(PROGRAMS)) : $( LIB_H ) $( wildcard */*.h )
$(patsubst perf-%,%.o,$(PROGRAMS)) : $( LIB_H ) $( wildcard */*.h )
# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
# we depend the various files onto their directories.
@ -1168,7 +952,7 @@ export perfexec_instdir
install : all
$( INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
$( INSTALL) $( OUTPUT) perf$X '$(DESTDIR_SQ)$(bindir_SQ)'
$( INSTALL) $( OUTPUT) perf '$(DESTDIR_SQ)$(bindir_SQ)'
$( INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
$( INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
$( INSTALL) $( OUTPUT) perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
@ -1267,7 +1051,7 @@ distclean: clean
clean :
$( RM) $( OUTPUT) { *.o,*/*.o,*/*/*.o,*/*/*/*.o,$( LIB_FILE) ,perf-archive}
$( RM) $( ALL_PROGRAMS) $( BUILT_INS) perf$X
$( RM) $( ALL_PROGRAMS) $( BUILT_INS) perf
$( RM) $( TEST_PROGRAMS)
$( RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $( OUTPUT) common-cmds.h TAGS tags cscope*
$( RM) -r $( PERF_TARNAME) .doc-tmp-dir