Is it possible to do make clean from the parent directory, which also recursively cleans all subdirectories without having to include the makefile in each subdirectory?
For example, currently in my Makefile I have something like:
SUBDIRS = src, src1 .PHONY: clean subdirs $(SUBDIRS) clean: $(SUBDIRS) rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c $(SUBDIRS): $(MAKE) -C $(SUBDIRS) clean
However, this requires that I have a Makefile in src and src1. Otherwise, I get an error
No rule to make target clean
Since I always want to run the command "rm -rf * .o ~ core.depend..cmd * .ko * .mod.c" in any subdirectory, it seems unnecessary to include the Makefile in each subdirectory with the same line for cleaning. Is there no way to just execute the same clean command in each of the subdirectories?
source share