-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools/labs: Change make clean rule to only remove generated files #145
Conversation
@@ -39,6 +39,12 @@ docs: | |||
cp -r $(KDIR)/Documentation/output/slides/teaching/_static $(KDIR)/Documentation/output/teaching/ | |||
|
|||
clean:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please also fix this typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean::
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not a typo. It's Makefile syntax for running multiple clean targets. There's a clean target in this file, and there's another "clean::" in "qemu/Makefile", which is included. By using "clean::" you run both clean targets:
https://web.archive.org/web/20180122002430/http://owen.sj.ca.us/~rk/howto/slides/make/slides/makecolon.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments.
tools/labs/Makefile
Outdated
@@ -39,6 +39,12 @@ docs: | |||
cp -r $(KDIR)/Documentation/output/slides/teaching/_static $(KDIR)/Documentation/output/teaching/ | |||
|
|||
clean:: | |||
-rm -rf skels | |||
find skels -type f \( -name *.mod.* -or -name *.ko -or -executable -or -name *.cmd -or -name *.o \) | xargs --no-run-if-empty rm || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to add || true
. You can just prefix the command with -
(minus). See https://stackoverflow.com/a/3477400/4804196.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It make be that we want to have executable files or object files as part of the skeleton. So maybe removing those isn't the way to go.
The best way would be to look for all Makefile
files and call make -C $MAKEFILE_DIR clean
, where $MAKEFILE_DIR
is the directory where the Makefile
exists.
|
||
.PHONY: skels build copy docs clean | ||
clean_skels: | ||
rm -rf skels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the -
(minus) prefix here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do this in a later PR.
Signed-off-by: Sergiu Weisz <[email protected]>
d8c2120
to
b6fedc0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all good
Address issue #134 by moving the deletion of the skels directory to another target, and change the clean target to only delete generated files