@@ -325,9 +325,9 @@ SCRIPT_SH += perf-archive.sh
325
325
grep-libs = $(filter -l% ,$(1 ) )
326
326
strip-libs = $(filter-out -l% ,$(1 ) )
327
327
328
- pyrf : $(PYRF_OBJS )
329
- python util/setup.py build --build-base =' $(OUTPUT)'
330
-
328
+ $( OUTPUT ) python/perf.so : $(PYRF_OBJS )
329
+ @ python util/setup.py --quiet build_ext --build-lib =' $(OUTPUT)python ' \
330
+ --build-temp= ' $(OUTPUT)python/temp '
331
331
#
332
332
# No Perl scripts right now:
333
333
#
@@ -348,12 +348,14 @@ PROGRAMS += $(EXTRA_PROGRAMS)
348
348
#
349
349
PROGRAMS += $(OUTPUT ) perf
350
350
351
+ LANG_BINDINGS =
352
+
351
353
# List built-in command $C whose implementation cmd_$C() is not in
352
354
# builtin-$C.o but is linked in as part of some other command.
353
355
#
354
356
355
357
# what 'all' will build and 'install' will install, in perfexecdir
356
- ALL_PROGRAMS = $(PROGRAMS ) $(SCRIPTS ) pyrf
358
+ ALL_PROGRAMS = $(PROGRAMS ) $(SCRIPTS )
357
359
358
360
# what 'all' will build but not install in perfexecdir
359
361
OTHER_PROGRAMS = $(OUTPUT ) perf$X
@@ -662,12 +664,14 @@ else
662
664
PYTHON_EMBED_CCOPTS = `python-config --cflags 2>/dev/null`
663
665
FLAGS_PYTHON_EMBED=$(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
664
666
ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
667
+ msg := $(warning No Python.h found, install python-dev[el] to have python support in 'perf script' and to build the python bindings)
665
668
BASIC_CFLAGS += -DNO_LIBPYTHON
666
669
else
667
670
ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS )
668
671
EXTLIBS += $(PYTHON_EMBED_LIBADD )
669
672
LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
670
673
LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
674
+ LANG_BINDINGS += $(OUTPUT)python/perf.so
671
675
endif
672
676
endif
673
677
@@ -954,7 +958,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
954
958
955
959
SHELL = $(SHELL_PATH )
956
960
957
- all :: shell_compatibility_test $(ALL_PROGRAMS ) $(BUILT_INS ) $(OTHER_PROGRAMS ) $(OUTPUT ) PERF-BUILD-OPTIONS
961
+ all :: shell_compatibility_test $(ALL_PROGRAMS ) $(LANG_BINDINGS ) $( BUILT_INS ) $(OTHER_PROGRAMS ) $(OUTPUT ) PERF-BUILD-OPTIONS
958
962
ifneq (,$X)
959
963
$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
960
964
endif
@@ -1287,17 +1291,17 @@ distclean: clean
1287
1291
# $(RM) configure
1288
1292
1289
1293
clean :
1290
- $(RM ) * .o * /* .o * /* /* .o * /* /* /* .o $(LIB_FILE )
1294
+ $(RM ) $( OUTPUT ) { * .o, * /* .o, * /* /* .o, * /* /* /* .o, $(LIB_FILE ) ,perf-archive}
1291
1295
$(RM ) $(ALL_PROGRAMS ) $(BUILT_INS ) perf$X
1292
1296
$(RM ) $(TEST_PROGRAMS )
1293
1297
$(RM ) * .spec * .pyc * .pyo * /* .pyc * /* .pyo $(OUTPUT ) common-cmds.h TAGS tags cscope*
1294
- $(RM ) -r autom4te.cache
1295
- $(RM ) config.log config.mak.autogen config.mak.append config.status config.cache
1296
1298
$(RM ) -r $(PERF_TARNAME ) .doc-tmp-dir
1297
1299
$(RM ) $(PERF_TARNAME ) .tar.gz perf-core_$(PERF_VERSION ) -* .tar.gz
1298
1300
$(RM ) $(htmldocs ) .tar.gz $(manpages ) .tar.gz
1299
1301
$(MAKE ) -C Documentation/ clean
1300
1302
$(RM ) $(OUTPUT ) PERF-VERSION-FILE $(OUTPUT ) PERF-CFLAGS $(OUTPUT ) PERF-BUILD-OPTIONS
1303
+ @python util/setup.py clean --build-lib=' $(OUTPUT)python' \
1304
+ --build-temp=' $(OUTPUT)python/temp'
1301
1305
1302
1306
.PHONY : all install clean strip
1303
1307
.PHONY : shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
0 commit comments