-
Notifications
You must be signed in to change notification settings - Fork 577
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
Makefile: Add clean_builtsrc
, clean_builtassets
#1444
Conversation
Makefile
Outdated
@@ -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 {} \; |
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 is this find
doing exactly?
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'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
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.
(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)
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.
I'm fine with this implementation, but thoughts on instead of new targets, use clean with an env variable (i.e. clean TARGET=builtsrc
). I'll admit does seem a little more clunky.
# Delete files directly inside build/ (but not in subfolders) | ||
find build -maxdepth 1 -type f -exec $(RM) {} \; | ||
|
||
clean_builtassets: |
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_builtassets: | |
builtassetsclean: |
Wonder if this would be better to mirror assetclean
? (same idea with clean_builtsrc
)
Or perhaps builtassets_clean
and assets_clean
?
I don't think this is going anywhere, so, closing |
TLDR
This PR adds
clean_builtsrc
(to rebuildsrc/
),and
clean_builtassets
(to rebuildassets/
)make clean && make
: 3min40smake clean_builtsrc && make
: 1min40smake clean_builtassets && make
: 2min10sMotivation
make clean
is often used when building (make
) fails for some obscure reason, or the ROM doesn't build OK for equally obscure reasonsBuilding from clean (
make
aftermake clean
) takes a long time, 3min40s for me without-j
.The "clean" operation can however be separated into two parts: cleaning built assets (in
build/assets
) and built source (inbuild/src
)It is very rarely useful or required to rebuild all of both of these, and typically rebuilding all of either is enough
This PR adds
clean_builtsrc
andclean_builtassets
alongsideclean
.Where
clean
removes the wholebuild
folder of intermediate files,clean_builtsrc
focuses onbuild/src
andclean_builtassets
onbuild/assets
(they both also remove other thingsclean
removes, see theMakefile
)Building from
clean_builtsrc
(i.e. re-buildingsrc/
) is 1min40s for me, half the time to build from clean (stillmake
without-j
)And building from
clean_builtassets
(i.e. re-buildingassets/
) is 2min10s for me