kubilus1 / gendev

Genesis development environment for Linux.
BSD 3-Clause "New" or "Revised" License
209 stars 23 forks source link

not able to build project using sgdk/skeleton #34

Closed v4ld3r5 closed 7 years ago

v4ld3r5 commented 7 years ago

Hi, I created a "hello world" project by copying sgdk/skeleton content and not able to build it:

v4ld3r5@debian:~/src/gendev/examples/3d_example$ make
/opt/gendev/bin/m68k-elf-gcc   -m68000 -Wall -O2 -c -fomit-frame-pointer -I. -I/opt/gendev/m68k-elf/include -I/opt/gendev/m68k-elf/include -Isrc -Ires -c boot/rom_head.c -o boot/rom_head.o
boot/rom_head.c:1:19: fatal error: types.h: No such file or directory

                   ^
compilation terminated.
Makefile:147: recipe for target 'boot/rom_head.o' failed
make: *** [boot/rom_head.o] Error 1
v4ld3r5@debian:~/src/gendev/examples/3d_example$ make
/opt/gendev/bin/m68k-elf-gcc   -m68000 -Wall -O2 -c -fomit-frame-pointer -I. -I/opt/gendev/m68k-elf/include -I/opt/gendev/m68k-elf/include -I/opt/gendev/sgdk/inc -Isrc -Ires -c boot/rom_head.c -o boot/rom_head.o
/opt/gendev/bin/m68k-elf-ld -T /opt/gendev/ldscripts/sgdk.ld -Map=output.map -nostdlib  --oformat binary -o boot/rom_head.bin boot/rom_head.o
/opt/gendev/bin/m68k-elf-ld: cannot open linker script file /opt/gendev/ldscripts/sgdk.ld: No such file or directory
Makefile:199: recipe for target 'boot/rom_head.bin' failed
make: *** [boot/rom_head.bin] Error 1
v4ld3r5@debian:~/src/gendev/examples/3d_example$ make
/opt/gendev/bin/m68k-elf-ld -T /opt/gendev/ldscripts/sgdk.ld -Map=output.map -nostdlib  --oformat binary -o boot/rom_head.bin boot/rom_head.o
/opt/gendev/bin/m68k-elf-as -m68000 --register-prefix-optional boot/sega.s -o boot/sega.o
/opt/gendev/bin/m68k-elf-gcc   -m68000 -Wall -O2 -c -fomit-frame-pointer -I. -I/opt/gendev/m68k-elf/include -I/opt/gendev/m68k-elf/include -I/opt/gendev/sgdk/inc -Isrc -Ires -c main.c -o main.o
In file included from /opt/gendev/sgdk/inc/genesis.h:11:0,
                 from main.c:1:
/opt/gendev/sgdk/inc/memory.h:210:6: warning: conflicting types for built-in function 'memset'
 void memset(void *to, u8 value, u16 len);
      ^~~~~~
/opt/gendev/sgdk/inc/memory.h:253:6: warning: conflicting types for built-in function 'memcpy'
 void memcpy(void *to, const void *from, u16 len);
      ^~~~~~
In file included from /opt/gendev/sgdk/inc/genesis.h:14:0,
                 from main.c:1:
/opt/gendev/sgdk/inc/font.h:18:20: fatal error: libres.h: No such file or directory

                    ^
compilation terminated.
Makefile:148: recipe for target 'main.o' failed
make: *** [main.o] Error 1

Br, Dani

v4ld3r5 commented 7 years ago

Hi, I was able to progress, fixed above issues by including extra paths in INC and LIB, in the skeleton Makefile; plus I added this line to "sgdk/Makefile" to solve the "sgdk.ld" issue, just at the end of the "install" target:

        cp files/sgdk.ld $(GENDEV)/ldscripts/.

I can create a PR for these if needed. Now hit another issue and dunno how to progress, looks like it's still missing some symbols?

/opt/gendev/bin/m68k-elf-ld -o out.elf -T /opt/gendev/ldscripts/sgdk.ld -Map=output.map -nostdlib   boot/sega.o /opt/gendev/sgdk/lib/libmd.a  /opt/gendev/lib/gcc/m68k-elf/6.3.0/libgcc.a    main.o   -L/opt/gendev/m68k-elf/lib -L/opt/gendev/m68k-elf/lib/gcc/m68k-elf/* -L/opt/gendev/sgdk/lib -lmd -lnosys
/opt/gendev/sgdk/lib/libmd.a(sys_a.o): In function `SYS_hardReset':
(.text+0x1c): undefined reference to `_hard_reset'
Makefile:135: recipe for target 'out.elf' failed
make: *** [out.elf] Error 1
rm main.o

....
/opt/gendev/bin/m68k-elf-nm /opt/gendev/sgdk/lib/libmd.a | grep _hard
         U _hard_reset
00000012 T SYS_hardReset

Br, Dani

v4ld3r5 commented 7 years ago

Sorry I completed missed the point on the README to build the SGDK project; so I was using the wrong makefile. Using it works like a charm. Is there a reason then to have that sgdk/skeleton?

In any case this can be closed. Cheers

kubilus1 commented 7 years ago

No worries. You are probably right that the sgdk/skeleton dir may no longer be useful (or perhaps counter productive). I've been attempting to clean this project up a bit, and likely have more to do!

v4ld3r5 commented 7 years ago

@kubilus1 hi, I would be more than happy to help, just need to get rid of the rust and get more and more in low-level . If you have specific things to focus on I may give it a chance

Br, Dani

Sent from my HUAWEI EVA-L09 using FastHub