diff --git a/Makefile b/Makefile index 57698d048e2caa..49152788ae59fe 100644 --- a/Makefile +++ b/Makefile @@ -1341,6 +1341,12 @@ ifneq ($(wildcard $(resolve_btfids_O)),) $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean endif +tools-clean-targets := sched_ext +PHONY += $(tools-clean-targets) +$(tools-clean-targets): + $(Q)$(MAKE) -sC tools $@_clean +tools_clean: $(tools-clean-targets) + # Clear a bunch of variables before executing the submake ifeq ($(quiet),silent_) tools_silent=s @@ -1510,7 +1516,7 @@ PHONY += $(mrproper-dirs) mrproper $(mrproper-dirs): $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@) -mrproper: clean $(mrproper-dirs) +mrproper: clean $(mrproper-dirs) tools_clean $(call cmd,rmfiles) @find . $(RCS_FIND_IGNORE) \ \( -name '*.rmeta' \) \ diff --git a/tools/Makefile b/tools/Makefile index 37e9f680483264..8021267f7e5b69 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -29,6 +29,7 @@ help: @echo ' pci - PCI tools' @echo ' perf - Linux performance measurement and analysis tool' @echo ' selftests - various kernel selftests' + @echo ' sched_ext - sched_ext example schedulers' @echo ' bootconfig - boot config tool' @echo ' spi - spi tools' @echo ' tmon - thermal monitoring and tuning tool' @@ -92,6 +93,9 @@ perf: FORCE $(Q)mkdir -p $(PERF_O) . $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= +sched_ext: FORCE + $(call descend,sched_ext) + selftests: FORCE $(call descend,testing/$@) @@ -185,6 +189,9 @@ perf_clean: $(Q)mkdir -p $(PERF_O) . $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean +sched_ext_clean: + $(call descend,sched_ext,clean) + selftests_clean: $(call descend,testing/$(@:_clean=),clean) @@ -214,6 +221,7 @@ clean: acpi_clean cgroup_clean counter_clean cpupower_clean hv_clean firewire_cl mm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \ freefall_clean build_clean libbpf_clean libsubcmd_clean \ gpio_clean objtool_clean leds_clean wmi_clean pci_clean firmware_clean debugging_clean \ - intel-speed-select_clean tracing_clean thermal_clean thermometer_clean thermal-engine_clean + intel-speed-select_clean tracing_clean thermal_clean thermometer_clean thermal-engine_clean \ + sched_ext_clean .PHONY: FORCE diff --git a/tools/sched_ext/Makefile b/tools/sched_ext/Makefile index f1d718c2ff1cef..107aa2613a7518 100644 --- a/tools/sched_ext/Makefile +++ b/tools/sched_ext/Makefile @@ -228,6 +228,9 @@ clean: rm -f *.o *.bpf.o *.skel.h *.subskel.h rm -f scx_simple scx_qmap scx_central scx_pair scx_flatcg scx_userland +fullclean: clean + $(Q)$(MAKE) -sC ../../ clean + help: @echo 'Building targets:' @echo ' all - Compile all schedulers' @@ -282,8 +285,12 @@ help: @echo 'Cleaning targets:' @echo ' clean - Remove all generated files, including intermediate' @echo ' rust files for rust schedulers.' + @echo '' + @echo ' fullclean - Remove all generated files, including intermediate' + @echo ' rust files for rust schedulers, and also trigger a' + @echo ' clean of the kernel at the root of the whole repository.' -.PHONY: all scx_rusty clean help +.PHONY: all scx_rusty clean fullclean help # delete failed targets .DELETE_ON_ERROR: diff --git a/tools/sched_ext/README.md b/tools/sched_ext/README.md index c5031d073a4919..e030b1931ac262 100644 --- a/tools/sched_ext/README.md +++ b/tools/sched_ext/README.md @@ -358,9 +358,13 @@ clang than what's supported (i.e. older than 16.0.0). To remediate this: 1. `which clang` to make sure you're using a sufficiently new version of clang. -2. `make mrproper` in the root path of the repository, and rebuild the kernel. +2. `make fullclean` in the root path of the repository, and rebuild the kernel + and schedulers. -3. `make clean` in the example scheduler directory and rebuild the schedulers. +3. Rebuild the kernel, and then your example schedulers. + +The schedulers are also cleaned if you invoke `make mrproper` in the root +directory of the tree. ### Stale kernel build / incomplete vmlinux.h file