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

Makefile: Add clean_builtsrc, clean_builtassets #1444

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ endif
clean:
$(RM) -r $(ROM) $(ELF) build

clean_builtsrc:
$(RM) -r $(ROM) $(ELF) build/src build/data
find build -maxdepth 1 -type f -exec rm {} \;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this find doing exactly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's removing files directly inside build/, i.e.
dmadata_table_spec.h ldscript.txt spec undefined_syms.txt z64.map (in build/)

I could also put that list of files into the makefile tbh but it felt less random to remove all files

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(fwiw this is not advanced find usage at all, assuming this may get in and if we keep it I'll add a comment on it though)


clean_builtassets:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
clean_builtassets:
builtassetsclean:

Wonder if this would be better to mirror assetclean? (same idea with clean_builtsrc)
Or perhaps builtassets_clean and assets_clean?

$(RM) -r $(ROM) $(ELF) build/assets
find build -maxdepth 1 -type f -exec rm {} \;

assetclean:
$(RM) -r $(ASSET_BIN_DIRS)
$(RM) -r assets/text/*.h
Expand All @@ -271,7 +279,7 @@ test: $(ROM)
$(EMULATOR) $(EMU_FLAGS) $<


.PHONY: all clean setup test distclean assetclean
.PHONY: all clean clean_builtsrc clean_builtassets setup test distclean assetclean

#### Various Recipes ####

Expand Down