[Help] How to compile a CIA from Github

Discussion in '3DS - Homebrew Development and Emulators' started by spkuja, Jun 16, 2017.

  1. spkuja
    OP

    spkuja GBAtemp Regular

    Member
    255
    76
    May 7, 2007
    As the title says.

    How would I compile the CIA file from a github?

    I know I need to use "make" but I cannot for the life of me find how to install this on Windows 10....

    Any help would be greatly appreciated!
     
  2. Somebody Whoisbored

    Somebody Whoisbored it's all okeydokey

    Member
    478
    166
    May 12, 2016
    United States
    hypeland
    Simply install devkitPro. It comes with make and everything needed to build 3DS homebrew. Make sure to enable devkitARM in the installation if it isn't already.
     
  3. spkuja
    OP

    spkuja GBAtemp Regular

    Member
    255
    76
    May 7, 2007
    I've tried that already. When I run: make "Path\to\file\Makefile"

    I get: make: Nothing to be done for 'Path\to\file\'.

    Any clues?
     
  4. Tenshi_Okami

    Tenshi_Okami GBAtemp Maniac

    Member
    1,405
    580
    Nov 3, 2015
    Puerto Rico
    What do you want to be compiled? I'll compile it for you :3
     
  5. Somebody Whoisbored

    Somebody Whoisbored it's all okeydokey

    Member
    478
    166
    May 12, 2016
    United States
    hypeland
    Try running make within the directory by either cd'ing to it or hold shift-right click in the folder and selecting Run command window here. Then just run "make"
     
  6. spkuja
    OP

    spkuja GBAtemp Regular

    Member
    255
    76
    May 7, 2007
    Thank you for the offer, but I need to work this out for myself :)

    I think that worked but it didn't output a CIA. Do I need to run Buildtools separately?
     
  7. Tenshi_Okami

    Tenshi_Okami GBAtemp Maniac

    Member
    1,405
    580
    Nov 3, 2015
    Puerto Rico
    Well, what's the GitHub? Probably needs some stuff installed rather than just DevkitPro
     
  8. Somebody Whoisbored

    Somebody Whoisbored it's all okeydokey

    Member
    478
    166
    May 12, 2016
    United States
    hypeland
    If it outputted a 3dsx and smdh, then it probably had all the dependencies.
     
  9. Somebody Whoisbored

    Somebody Whoisbored it's all okeydokey

    Member
    478
    166
    May 12, 2016
    United States
    hypeland
    Most likely. What files did it output?
     
  10. spkuja
    OP

    spkuja GBAtemp Regular

    Member
    255
    76
    May 7, 2007
    I think I know the issue. It's throwing an error:

    Code:
    source/ui/section/types.h:44:2: error: expected '}' before numeric constant
    source/ui/section/types.h:44:2: error: expected unqualified-id before numeric constant
    In file included from source/ui/section/lib.h:38:0,
                     from source/ui/section/utils.cpp:19:
    source/ui/section/types.h:48:1: error: expected declaration before '}' token
     } endianness_flag;
    The file that's throwing the error has this code in it:

    Code:
    /**
    Copyright 2013 3DSGuy
    
    This file is part of make_cdn_cia.
    
    make_cdn_cia is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    make_cdn_cia is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with make_cdn_cia.  If not, see <http://www.gnu.org/licenses/>.
    **/
    #include <stdlib.h>
    #include <stdint.h>
    //Bools
    typedef enum
    {
        False,
        True
    } _boolean;
    
    typedef enum
    {
        Good,
        Fail
    } return_basic;
    
    typedef enum
    {
        ARGC_FAIL = 1,
        ARGV_FAIL,
        IO_FAIL,
        FILE_PROCESS_FAIL
    } errors;
    
    typedef enum
    {
        BIG_ENDIAN = 0,
        LITTLE_ENDIAN = 1,
        BE = 0,
        LE = 1
    } endianness_flag;
    I won't lie, I know nothing about the above code so I don't know how to fix it
     
  11. Somebody Whoisbored

    Somebody Whoisbored it's all okeydokey

    Member
    478
    166
    May 12, 2016
    United States
    hypeland
    I'm not much of a C++ coder myself. So your guess is as good as mine. Check if the project has any specific ways of building it, or if it is just make.
     
  12. spkuja
    OP

    spkuja GBAtemp Regular

    Member
    255
    76
    May 7, 2007
    I think it is something to do with the types.h file, which I quoted above.

    It's kicking out an error that I don't understand.
     
    Last edited by spkuja, Jun 16, 2017
  13. PewnyPL

    PewnyPL GBAtemp Advanced Fan

    Member
    592
    255
    Feb 2, 2014
    Poland
    From what I see online, this is because in another part of the program (or most likely in the libraries themselves) BIG_ENDIAN is already defined as a constant, so here, the preprocessor just substitutes that word for whatever value it is (let's say, 1) so the code looks like 1 = 1. Most likely, the homebrew you are trying to compile was using an older version of devkitPro, or ctrulib. You'd need to install those versions instead of current one, but figuring out which one is needed... now this will be a pain.
     
    spkuja likes this.
  14. spkuja
    OP

    spkuja GBAtemp Regular

    Member
    255
    76
    May 7, 2007
    I did (finally!) manage to get it to compile! It seems to work, but I need to do some more testing now to make sure it's all good :).

    Thanks for the info though!