Skip to content

Commit ea01fa9

Browse files
Borislav Petkovacmel
Borislav Petkov
authored andcommitted
tools: Connect to the kernel build system
Now you can do $ make tools/<toolname> from the toplevel kernel directory and have the respective tool built. If you want to build and install it, do $ make tools/<toolname>_install $ make tools/<toolname>_clean should clean the respective tool directories. If you want to clean all in tools, simply do $ make tools/clean Also, if you want to get what the possible targets are, simply calling $ make tools/ should give you the short help. $ make tools/install installs all tools, of course. Doh. Signed-off-by: Borislav Petkov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Michal Marek <[email protected]> Cc: Sam Ravnborg <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent d5dd8af commit ea01fa9

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,13 @@ kernelrelease:
14681468
kernelversion:
14691469
@echo $(KERNELVERSION)
14701470

1471+
# Clear a bunch of variables before executing the submake
1472+
tools/: FORCE
1473+
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/
1474+
1475+
tools/%: FORCE
1476+
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ $*
1477+
14711478
# Single targets
14721479
# ---------------------------------------------------------------------------
14731480
# Single targets are compatible with:

tools/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ help:
1414
@echo ' vm - misc vm tools'
1515
@echo ' x86_energy_perf_policy - Intel energy policy tool'
1616
@echo ''
17+
@echo 'You can do:'
18+
@echo ' $$ make -C tools/<tool>_install'
19+
@echo ''
20+
@echo ' from the kernel command line to build and install one of'
21+
@echo ' the tools above'
22+
@echo ''
23+
@echo ' $$ make tools/install'
24+
@echo ''
25+
@echo ' installs all tools.'
26+
@echo ''
1727
@echo 'Cleaning targets:'
1828
@echo ''
1929
@echo ' all of the above with the "_clean" string appended cleans'

0 commit comments

Comments
 (0)