Skip to content
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

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

Sergiu121
Copy link

Address issue #134 by moving the deletion of the skels directory to another target, and change the clean target to only delete generated files

tavip pushed a commit to linux-kernel-labs/linux-kernel-labs.github.io that referenced this pull request Feb 28, 2020
@@ -39,6 +39,12 @@ docs:
cp -r $(KDIR)/Documentation/output/slides/teaching/_static $(KDIR)/Documentation/output/teaching/

clean::

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What typo?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean::

Copy link
Author

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

Copy link

@razvand razvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments.

@@ -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
Copy link

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.

Copy link

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
Copy link

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.

Copy link
Author

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.

Copy link

@razvand razvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good

@Sergiu121 Sergiu121 merged commit 96a0222 into linux-kernel-labs:master Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants