Vulcalien / minicraft-gba

Minicraft ported to the GBA
GNU General Public License v3.0
84 stars 3 forks source link

[Question]: Is it possible to build the game using Termux? #13

Open ErickN13 opened 3 weeks ago

Vulcalien commented 2 weeks ago

I remember trying without success.

It should be possible, given that the arm-none-eabi-gcc compiler is installed. I think the best option is to download the compiler's binary executables from ARM's website, if they are available.

It might also be necessary to change the compiler name in Makefile.

ErickN13 commented 2 weeks ago

The Device Architecture I use is Armeabi-v7a, so I don't know if it's possible to build the game.

ErickN13 commented 2 weeks ago

But in which lines of the Makefile can I change the Compiler, and which ones are Compatible?

ErickN13 commented 2 weeks ago

I use GNU Make and Clang. I typed these commands in the Terminal to see the Compiler version ~ $ gcc -v clang version 15.0.7 Target: armv7a-unknown-linux-android24 Thread model: posix InstalledDir: /data/data/com.alif.ide.python/files/alif/bin ~ $ make -v GNU Make 4.4.1 Built for arm-unknown-linux-androideabi Copyright (C) 1988-2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Vulcalien commented 2 weeks ago

The lines in Makefile that might have to be changed are these:

ifeq ($(CURRENT_OS),UNIX)
    CC      := arm-none-eabi-gcc
    AS      := arm-none-eabi-as
    OBJCOPY := arm-none-eabi-objcopy

    EMULATOR := mgba-qt
else ifeq ($(CURRENT_OS),WINDOWS)
    ...

changing CC, AS and OBJCOPY to the installed compiler and tools.

There could be a fair amount of tinkering to get the game to compile on that platform, including potentially missing libraries (newlib??) and tools.

What I would try, since I'm not sure clang can compile the game considering I'm using GCC extensions and linker script, is downloading arm-none-eabi-gcc directly from ARM's website. Pretty sure this is the correct download page: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

ErickN13 commented 2 weeks ago

What are AS and OBJCOPY? and what do they do? (Just a question)

Vulcalien commented 2 weeks ago

AS is the assembler, needed for a few assembly files required in the code. OBJCOPY is the tool I use to convert ELF files into raw (GBA) files.

Basically the game gets first compiled into ELF, then converted into GBA cartridge format.

ErickN13 commented 2 weeks ago

The lines in Makefile that might have to be changed are these:

ifeq ($(CURRENT_OS),UNIX)
  CC      := arm-none-eabi-gcc
  AS      := arm-none-eabi-as
  OBJCOPY := arm-none-eabi-objcopy

  EMULATOR := mgba-qt
else ifeq ($(CURRENT_OS),WINDOWS)
  ...

changing CC, AS and OBJCOPY to the installed compiler and tools.

There could be a fair amount of tinkering to get the game to compile on that platform, including potentially missing libraries (newlib??) and tools.

What I would try, since I'm not sure clang can compile the game considering I'm using GCC extensions and linker script, is downloading arm-none-eabi-gcc directly from ARM's website. Pretty sure this is the correct download page: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

the only problem is that I only use Android, and the arm-none-eabi-gcc objcopy and as, is not possible to install on Android (as far as I know)