Homebrew Compile homebrew with premake

doyoulovecake

New Member
OP
Newbie
Joined
Jan 22, 2020
Messages
3
Trophies
0
Age
34
XP
44
Country
United States
My premake builds 3dsx files that only work on emulators and crash on real 3DS hardware, since I want to move from Makefiles i would like your help to debug which flags I am missing here. Translating the Makefile to a command line compilation would also help a lot since it doesn't output how the program is being linked.

Example premake file, the Makefile I want to translate is the default included in devkitpro 3ds examples:
Code:
workspace "v"
   configurations { "Debug", "Release" }

local devkitpro = os.getenv("DEVKITPRO")
local devkitarm = os.getenv("DEVKITARM")

project "v"
   kind "ConsoleApp"
   language "C++"
   targetdir "bin/%{cfg.buildcfg}"

   makesettings [[
       CXX = arm-none-eabi-g++
       LD = arm-none-eabi-ld
   ]]

   files {
       "./src/**.h",
       "./src/**.cpp"
   }

   defines {
       "_3DS",
       "ARM11",
   }

   includedirs {
       "include",
       "include/m3d",
       "src",
       devkitpro .. "/libctru/include",
       devkitpro .. "/portlibs/3ds/include",
   }

   links {
       "m3dia",
       "citro2d",
       "citro3d",
       "ctru",
   }

   libdirs {
       devkitpro .. "/libctru/lib",
       devkitpro .. "/portlibs/3ds/lib",
   }

   buildoptions {
       "-g",
       "-Wall",
       "-std=gnu++11",
       "-mword-relocations",
       "-ffunction-sections",
       "-fno-rtti",
       "-fno-exceptions",
       "-fomit-frame-pointer",
       "-march=armv6k",
       "-mtune=mpcore",
       "-mfloat-abi=hard",
       "-mtp=soft",
   }

   linkoptions {
       "-o vida.3dsx",
       "-specs=3dsx.specs",
       "-march=armv6k",
       "-mtune=mpcore",
       "-mfloat-abi=hard",
       "-mtp=soft",
       "-Wl,-Map,8.map",
   }

   filter "configurations:Debug"
       defines { "DEBUG" }
       symbols "On"

   filter "configurations:Release"
       defines { "RELEASE" }
       optimize "On"
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
Citra can load elf files. Homebrew loaders on 3ds hardware cannot. You are skipping the elf to 3dsx conversion process.
Also - this is a bad idea. Just add some print statements to the makefile to see the link command line - not sure what you are hoping to see aside from that.
 
  • Like
Reactions: doyoulovecake

ghjfdtg

Well-Known Member
Member
Joined
Jul 13, 2014
Messages
1,366
Trophies
1
XP
3,304
Country
??? Why don't you just use the provided makefiles? What's wrong with them? They have a guarantee to work unlike what you have thrown together there and i would strongly recommend not rolling your own build system.
 

doyoulovecake

New Member
OP
Newbie
Joined
Jan 22, 2020
Messages
3
Trophies
0
Age
34
XP
44
Country
United States
Citra can load elf files. Homebrew loaders on 3ds hardware cannot. You are skipping the elf to 3dsx conversion process.
Also - this is a bad idea. Just add some print statements to the makefile to see the link command line - not sure what you are hoping to see aside from that.
Thanks for being helpful elhobbs! I will search how to generate the elf files and adapt to my preferred build system.
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
Thanks for being helpful elhobbs! I will search how to generate the elf files and adapt to my preferred build system.
It is not promising that you did not understand what I said - but good luck anyway.
I will caution you that this likely falls into the category of things that the devkitarm maintainers frown upon. It is fine to do for yourself, but best not shared with others.
Still curious though as to what the actual benefit is. What does this get you that a makefile fails to provide?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Veho @ Veho:
    Nobody is reading what you post.
  • Psionic Roshambo @ Psionic Roshambo:
    That Dell data breach is worse than people probably realize....
  • Psionic Roshambo @ Psionic Roshambo:
    When I worked for Dell we had access to data about military contracts and addresses for high ranking people.
  • Psionic Roshambo @ Psionic Roshambo:
    I personally handled a call from the second highest person at Raytheon. That call bothered me a lot... The guy was nice and smart what bothered me was the way management basically just blew him off instead of going the extra mile to help him.
  • Psionic Roshambo @ Psionic Roshambo:
    In the end that call ended up costing Dell millions in lost contracts with Raytheon, and really the issue could have been solved for like 450 bucks lol
  • NinStar @ NinStar:
    sometimes I wonder why anyone would ever buy mega man x legacy collection 2
  • NinStar @ NinStar:
    I always thought that capcom shuffled the games in these collection, but apparently they are all in chronological order, which makes legacy collection 2 worthless
  • BakerMan @ BakerMan:
    guys, i want to start singing pirate metal songs and sea shanties if i play sea of thieves
  • The Real Jdbye @ The Real Jdbye:
    find a pirate metal playlist
    +2
  • The Real Jdbye @ The Real Jdbye:
    and sing along
  • BakerMan @ BakerMan:
    nevermind i just learned swearing is against the rules in sea of thieves

    i was about to start singing the song i last put in "what song are you currently listening to" yesterday
  • BakerMan @ BakerMan:
    but yeah ig so
  • The Real Jdbye @ The Real Jdbye:
    swearing not allowed in a pirate game? what has the world come to
  • BakerMan @ BakerMan:
    (here's the song for context)
  • BigOnYa @ BigOnYa:
    Just add -izle to the end of every curse word, you will be fine.
    +2
  • The Real Jdbye @ The Real Jdbye:
    i like alestorm
    +1
  • The Real Jdbye @ The Real Jdbye:
    @BigOnYa too many syllables
    +1
  • BakerMan @ BakerMan:
    same lmao
  • BigOnYa @ BigOnYa:
    hi, welcome to the Temp!
    +1
  • BakerMan @ BakerMan:
    Welcome to the Underground!
    +1
  • BakerMan @ BakerMan:
    the booty boogie from (once again) the donkey kong country cartoon could also be a good song to sing while playing sea of thieves
  • BigOnYa @ BigOnYa:
    Please insert 25 cents for an additional 30 minutes of talk time.
    BigOnYa @ BigOnYa: Please insert 25 cents for an additional 30 minutes of talk time.