Hey folks!
I'm fairly new to the homebrew community and I was looking at all of the various tools that are necessary for making various homebrew apps. I have the template provided by devkitPro, but after some messing with it in Visual Studio 2019 (which, I may add, the ability to build from studio is quite nice), I thought to myself, "This isn't enough." Now I don't know if anything I'm doing here is extra or "useless" (chances are, it is. That's one of the caveats of being new after all). It's certainly helped me personally and I suppose that's what matters the most.
Naturally, after not really liking having to enter 3 different commands to first build my 3DSX/ELF/SMDH, then strip the ELF file, and then make a CIA (horrible, right?) I got cracking away at something new. What I've just designed has definitely streamlined the process of building all necessary files (3DSX, SMDH, ELF, and CIA) given that it mashes it down into one batch file that is modular in nature. I love it a lot!
Here's the setup:
1: Start off by placing the meta folder inside of your project directory as you might when making a banner or whatever (if you haven't already), and make it contain the following files:
author.txt, description.txt, and title.txt all pertain to the APP_AUTHOR, APP_DESCRIPTION, and APP_TITLE fields in the makefile respectively. They are single-line TXT files containing the entries for those fields. I mainly did this so that all of the metadata was in the ... well, metadata folder!
2: Edit Makefile so that the APP_AUTHOR, APP_DESCRIPTION, and APP_TITLE fields use ?= instead of :=
This is important as ?= says "Use whatever value is in the file here if it's not specified in the environment" (so if you forget your txt files, it has a fallback option). Personally I set it to this:
3: Create a new batch file named buildwithcia.bat in the root project directory
NOTE: If you haven't already, either specify bannertool, makerom, and strip-elf in your environment, or put the EXE files in the same directory as the batch file.
This batch file should have the following contents:
As you may be able to see, you can execute this batch with buildwithcia NO_CIA to only do a stock build operation.
4: In VS2019, edit the solution's build command line
Any opinions on this? Stuff that I should change? I'm open to anything. Let me know if anything needs to be elaborated upon or if I'm being a complete idiot with how I'm doing something. Cheers.
I'm fairly new to the homebrew community and I was looking at all of the various tools that are necessary for making various homebrew apps. I have the template provided by devkitPro, but after some messing with it in Visual Studio 2019 (which, I may add, the ability to build from studio is quite nice), I thought to myself, "This isn't enough." Now I don't know if anything I'm doing here is extra or "useless" (chances are, it is. That's one of the caveats of being new after all). It's certainly helped me personally and I suppose that's what matters the most.
Naturally, after not really liking having to enter 3 different commands to first build my 3DSX/ELF/SMDH, then strip the ELF file, and then make a CIA (horrible, right?) I got cracking away at something new. What I've just designed has definitely streamlined the process of building all necessary files (3DSX, SMDH, ELF, and CIA) given that it mashes it down into one batch file that is modular in nature. I love it a lot!
Here's the setup:
1: Start off by placing the meta folder inside of your project directory as you might when making a banner or whatever (if you haven't already), and make it contain the following files:
author.txt, description.txt, and title.txt all pertain to the APP_AUTHOR, APP_DESCRIPTION, and APP_TITLE fields in the makefile respectively. They are single-line TXT files containing the entries for those fields. I mainly did this so that all of the metadata was in the ... well, metadata folder!
2: Edit Makefile so that the APP_AUTHOR, APP_DESCRIPTION, and APP_TITLE fields use ?= instead of :=
This is important as ?= says "Use whatever value is in the file here if it's not specified in the environment" (so if you forget your txt files, it has a fallback option). Personally I set it to this:
Code:
APP_TITLE ?= ERR_NO_APP_TITLE
APP_DESCRIPTION ?= ERR_NO_APP_DESCRIPTION
APP_AUTHOR ?= ERR_NO_APP_AUTHOR
3: Create a new batch file named buildwithcia.bat in the root project directory
NOTE: If you haven't already, either specify bannertool, makerom, and strip-elf in your environment, or put the EXE files in the same directory as the batch file.
This batch file should have the following contents:
Code:
@ECHO OFF
SET /p TITLE=<.\meta\title.txt
SET /p DESCRIPTION=<.\meta\description.txt
SET /p AUTHOR=<.\meta\author.txt
:BUILDMAIN
ECHO Building ELF, 3DSX, and SMDH...
MAKE APP_TITLE="%TITLE%" APP_DESCRIPTION="%DESCRIPTION%" APP_AUTHOR="%AUTHOR%"
IF "%1"=="NO_CIA" GOTO EOF
:MAKEBANNER
ECHO Making banner...
BANNERTOOL makebanner -i ".\meta\banner.png" -a ".\meta\banner.wav" -o ".\banner.bin"
:BUILDCIA
ECHO Building CIA...
STRIP-ELF YOUR_PROJECT_NAME.elf
MAKEROM -f cia -o YOUR_PROJECT_NAME.cia -rsf YOUR_PROJECT_NAME.rsf -target t -exefslogo -elf YOUR_PROJECT_NAME.elf -icon YOUR_PROJECT_NAME.smdh -banner banner.bin
:EOF
As you may be able to see, you can execute this batch with buildwithcia NO_CIA to only do a stock build operation.
4: In VS2019, edit the solution's build command line
Any opinions on this? Stuff that I should change? I'm open to anything. Let me know if anything needs to be elaborated upon or if I'm being a complete idiot with how I'm doing something. Cheers.
Last edited by EtiTheSpirit,