drojaazu / sgdk_nix

Makefiles and instructions for using SGDK in *nix environments
MIT License
29 stars 5 forks source link

Build of libmd_debug is broken #1

Closed kentosama closed 4 years ago

kentosama commented 4 years ago

Hello, I tried to compile several libmd_debug, but the lib is broken. GCC makes an 8kb file, which is not normal and does not work in all cases.

I did not compare the source makefile from SGDK.

SGDK Libs

-rw-r--r-- 1 kentosama kentosama 313654 mars  23 13:42 libmd.a
-rw-r--r-- 1 kentosama kentosama      8 mars  23 13:42 libmd_debug.a
lrwxrwxrwx 1 kentosama kentosama     36 mars  23 13:15 ligcc.a -> /usr/lib/gcc/m68k-elf/6.3.0/libgcc.a

SGDK build

kentosama@teradrive:/media/storage/repo/teradrive/sgdk/sgdk_nix$ ./setup.sh 
SGDK for *nix - Initial Setup
Please specify SGDK directory: /media/storage/repo/teradrive/sgdk/source/SGDK-master
Please specify M68k toolchain prefix: m68k-elf-

Checking for necessary tools...
gcc ... found!
unzip ... found!
java ... found!
sjasmplus ... found!
m68k-elf-gcc ... found!
m68k-elf-objcopy ... found!
m68k-elf-nm ... found!
m68k-elf-ld ... found!

Updating project and library makefiles... done!

Building appack...
gcc -Wall -O2 -s -Ilib/elf64 -o out/appack example/appack.c lib/elf64/aplib.a
Copied out/appack to /media/storage/repo/teradrive/sgdk/source/SGDK-master/bin
Success!

Building xgmtool...
gcc -fexpensive-optimizations -Os -s -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/inc -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/out/xgmtool /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/samplebank.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgmcom.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/psg.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/gd3.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgm.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/vgm.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/util.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/vgmcom.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/ym2612.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgccom.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgmsmp.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgmtool.c /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgc.c -lm
/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgccom.c: In function ‘XGCCommand_createStateCommand’:
/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgccom.c:217:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
         data[off++] = (int) curState->element;
                       ^
/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgccom.c:219:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
         data[off++] = (int) curState->element;
                       ^
/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgc.c: In function ‘XGC_getStateChange’:
/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgc.c:554:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 result = insertAfterLList(result, (void*) addr);
                                                   ^
/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgc.c:555:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 result = insertAfterLList(result, (void*) YM2612_get(current, port, reg));
                                                   ^
/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/src/xgc.c:571:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         result = insertAfterLList(result, (void*) YM2612_get(current, 0, 0x2B));
                                           ^
Copied /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/xgmtool/out/xgmtool to /media/storage/repo/teradrive/sgdk/source/SGDK-master/bin
Success!

Building bintos...
gcc -Wall -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/bintos/out/bintos /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/bintos/src/bintos.c
/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/bintos/src/bintos.c: In function ‘main’:
/media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/bintos/src/bintos.c:47:11: warning: variable ‘ext’ set but not used [-Wunused-but-set-variable]
     char *ext;
           ^~~
Copied /media/storage/repo/teradrive/sgdk/source/SGDK-master/tools/bintos/out/bintos to /media/storage/repo/teradrive/sgdk/source/SGDK-master/bin
Success!

Building SGDK library...
java -jar /media/storage/repo/teradrive/sgdk/source/SGDK-master/bin/rescomp.jar /media/storage/repo/teradrive/sgdk/source/SGDK-master/res/libres.res /media/storage/repo/teradrive/sgdk/source/SGDK-master/res/libres.s
ResComp 2.64 - SGDK Resource Compiler - Copyright 2020 (Stephane Dallongeville)

Resource: BITMAP sgdk_logo "image/sgdk_logo.png" -1
--> executing plugin BITMAP...

Resource: TILESET font_default "image/font_default.png" -1
--> executing plugin TILESET...

Resource: PALETTE font_pal_default "image/font_default.png"
--> executing plugin PALETTE...

Resource: BIN stop_xgm "sound/stop_xgm.bin" 2 2 0 NONE FALSE
--> executing plugin BIN...
Executing /media/storage/repo/teradrive/sgdk/source/SGDK-master/bin/appack c pack.in pack.out -s 
appack, aPLib compression library example
Copyright 1998-2014 Joergen Ibsen (www.ibsensoftware.com)

  Syntax:

    Compress    :  appack c <file> <packed_file>
    Decompress  :  appack d <packed_file> <depacked_file>

Executing java -jar /media/storage/repo/teradrive/sgdk/source/SGDK-master/bin/lz4w.jar p pack.in pack.out -s 
Packed with LZ4W, 'font_default_data' final size = 694 (23% - origin size = 3072)
Executing /media/storage/repo/teradrive/sgdk/source/SGDK-master/bin/appack c pack.in pack.out -s 
appack, aPLib compression library example
Copyright 1998-2014 Joergen Ibsen (www.ibsensoftware.com)

  Syntax:

    Compress    :  appack c <file> <packed_file>
    Decompress  :  appack d <packed_file> <depacked_file>

Executing java -jar /media/storage/repo/teradrive/sgdk/source/SGDK-master/bin/lz4w.jar p prev.in@pack.in pack.out -s 
Packed with LZ4W, 'sgdk_logo_data' final size = 1412 (69% - origin size = 2048)
/media/storage/repo/teradrive/sgdk/source/SGDK-master/res/libres.res summary:
-------------
Binary data: 2342 bytes
  Unpacked: 236 bytes
  Packed: 2106 bytes (41% - origin size: 5120 bytes)
Misc metadata (bitmap, image, tilemap, tileset, palette..): 34 bytes
Total: 2376 bytes (2 KB)
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/res/libres.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/res/libres.o
sjasmplus -i/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -i/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc --raw=/media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv1.o80 /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv1.s80
SjASMPlus Z80 Cross-Assembler v1.14.5 (https://github.com/z00m128/sjasmplus)
Pass 1 complete (0 errors)
Pass 2 complete (0 errors)
Pass 3 complete
Errors: 0, warnings: 0, compiled: 3984 lines, work time: 0.030 seconds
/media/storage/repo/teradrive/sgdk/source/SGDK-master/bin/bintos /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv1.o80
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv1.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv1.o
sjasmplus -i/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -i/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc --raw=/media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv2.o80 /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv2.s80
SjASMPlus Z80 Cross-Assembler v1.14.5 (https://github.com/z00m128/sjasmplus)
Pass 1 complete (0 errors)
Pass 2 complete (0 errors)
Pass 3 complete
Errors: 0, warnings: 0, compiled: 4345 lines, work time: 0.025 seconds
/media/storage/repo/teradrive/sgdk/source/SGDK-master/bin/bintos /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv2.o80
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv2.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv2.o
sjasmplus -i/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -i/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc --raw=/media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv3.o80 /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv3.s80
SjASMPlus Z80 Cross-Assembler v1.14.5 (https://github.com/z00m128/sjasmplus)
Pass 1 complete (0 errors)
Pass 2 complete (0 errors)
Pass 3 complete
Errors: 0, warnings: 0, compiled: 3771 lines, work time: 0.024 seconds
/media/storage/repo/teradrive/sgdk/source/SGDK-master/bin/bintos /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv3.o80
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv3.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv3.o
sjasmplus -i/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -i/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc --raw=/media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_xgm.o80 /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_xgm.s80
SjASMPlus Z80 Cross-Assembler v1.14.5 (https://github.com/z00m128/sjasmplus)
Pass 1 complete (0 errors)
Pass 2 complete (0 errors)
Pass 3 complete
Errors: 0, warnings: 0, compiled: 7028 lines, work time: 0.055 seconds
/media/storage/repo/teradrive/sgdk/source/SGDK-master/bin/bintos /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_xgm.o80
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_xgm.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_xgm.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/dma_a.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/dma_a.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/smp_null_pcm.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/smp_null_pcm.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sys_a.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sys_a.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/kdebug.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/kdebug.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/maths3D_a.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/maths3D_a.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_tile_a.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_tile_a.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sram_a.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sram_a.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/memory_a.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/memory_a.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/smp_null.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/smp_null.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/bmp_a.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/bmp_a.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tools_a.s -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tools_a.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_vol.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_vol.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/maths.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/maths.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sprite_eng.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sprite_eng.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/types.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/types.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/psg.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/psg.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_dma.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_dma.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_log2.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_log2.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/fat16.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/fat16.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_pal.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_pal.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/xgm.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/xgm.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sram.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sram.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_tile.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_tile.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/maths3D.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/maths3D.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/joy.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/joy.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/bmp.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/bmp.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_log10.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_log10.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sound.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sound.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/ym2612.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/ym2612.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tools.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tools.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/memory.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/memory.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/dma.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/dma.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_cnv.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_cnv.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sys.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/sys.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/everdrive.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/everdrive.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_sin.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_sin.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_bg.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_bg.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/mapper.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/mapper.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vram.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vram.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/string.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/string.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/pal.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/pal.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/timer.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/timer.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_spr.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/vdp_spr.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_sqrt.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/tab_sqrt.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/inc -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/src -I/media/storage/repo/teradrive/sgdk/source/SGDK-master/res -O1 -ggdb -DDEBUG=1 -c /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_ctrl.c -o /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_ctrl.o
ar rs /media/storage/repo/teradrive/sgdk/source/SGDK-master/lib/libmd_debug.a
ar: création de /media/storage/repo/teradrive/sgdk/source/SGDK-master/lib/libmd_debug.a
rm /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_xgm.s /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv2.o80 /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv3.s /media/storage/repo/teradrive/sgdk/source/SGDK-master/res/libres.s /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_xgm.o80 /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv1.s /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv3.o80 /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv2.s /media/storage/repo/teradrive/sgdk/source/SGDK-master/src/z80_drv1.o80
Success!

Sample build

kentosama@teradrive:~/Workspace/Projects/helloworld$ make clean
kentosama@teradrive:~/Workspace/Projects/helloworld$ make debug
-e Beginning debug project build...
m68k-elf-gcc -m68000 -Wall -fno-builtin -Iinc -Isrc -Ires -I/usr/lib/sgdk/inc -I/usr/lib/sgdk/res -c src/boot/rom_head.c -o out/rom_head.o
m68k-elf-ld -T /usr/lib/sgdk/md.ld -nostdlib --oformat binary -o out/rom_head.bin out/rom_head.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -Iinc -Isrc -Ires -I/usr/lib/sgdk/inc -I/usr/lib/sgdk/res -c src/boot/sega.s -o out/sega.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -Iinc -Isrc -Ires -I/usr/lib/sgdk/inc -I/usr/lib/sgdk/res -O1 -ggdb -DDEBUG=1 -c src/main.c -o out/src/main.o
src/main.c:12:5: warning: first argument of 'main' should be 'int' [-Wmain]
 int main(u16 hard)
     ^~~~
src/main.c:12:5: warning: 'main' takes only zero or two arguments [-Wmain]
m68k-elf-gcc -m68000 -n -Wl,--build-id=none -T /usr/lib/sgdk/md.ld -nostdlib out/sega.o out/src/main.o /usr/lib/sgdk/lib/libmd_debug.a /usr/lib/sgdk/lib/libgcc.a -o out/rom.out
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `registersDump':
(.text.keepboot+0x266): undefined reference to `registerState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x26c): undefined reference to `registerState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x272): undefined reference to `registerState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x278): undefined reference to `registerState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x27e): undefined reference to `registerState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o:(.text.keepboot+0x284): more undefined references to `registerState' follow
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `busAddressErrorDump':
(.text.keepboot+0x2ca): undefined reference to `ext1State'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2d2): undefined reference to `addrState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2da): undefined reference to `ext2State'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2e2): undefined reference to `srState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2ea): undefined reference to `pcState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `exception4WDump':
(.text.keepboot+0x2f6): undefined reference to `srState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2fe): undefined reference to `pcState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x306): undefined reference to `ext1State'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `exceptionDump':
(.text.keepboot+0x312): undefined reference to `srState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x31a): undefined reference to `pcState'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `WrongVersion':
(.text.keepboot+0x240): undefined reference to `_start_entry'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `SkipSetup':
(.text.keepboot+0x246): undefined reference to `_reset_entry'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Bus_Error':
(.text.keepboot+0x32c): undefined reference to `busErrorCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Address_Error':
(.text.keepboot+0x342): undefined reference to `addressErrorCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Illegal_Instruction':
(.text.keepboot+0x358): undefined reference to `illegalInstCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Zero_Divide':
(.text.keepboot+0x36e): undefined reference to `zeroDivideCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Chk_Instruction':
(.text.keepboot+0x384): undefined reference to `chkInstCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Trapv_Instruction':
(.text.keepboot+0x39a): undefined reference to `trapvInstCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Privilege_Violation':
(.text.keepboot+0x3b0): undefined reference to `privilegeViolationCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Trace':
(.text.keepboot+0x3c6): undefined reference to `traceCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Line_1010_Emulation':
(.text.keepboot+0x3dc): undefined reference to `line1x1xCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Error_Exception':
(.text.keepboot+0x3f2): undefined reference to `errorExceptionCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_INT':
(.text.keepboot+0x404): undefined reference to `intCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_EXTINT':
(.text.keepboot+0x416): undefined reference to `internalExtIntCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_HINT':
(.text.keepboot+0x428): undefined reference to `internalHIntCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_VINT':
(.text.keepboot+0x43a): undefined reference to `internalVIntCB'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/src/main.o: in function `main':
/home/kentosama/Workspace/Projects/helloworld/src/main.c:14: undefined reference to `SYS_disableInts'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:15: undefined reference to `VDP_setScreenWidth320'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:16: undefined reference to `VDP_setScreenHeight224'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:17: undefined reference to `VDP_setPlanSize'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:18: undefined reference to `palette_grey'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:18: undefined reference to `VDP_setPalette'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:19: undefined reference to `palette_black'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:19: undefined reference to `VDP_setPaletteColors'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:20: undefined reference to `VDP_setTextPalette'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:21: undefined reference to `VDP_drawText'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:22: undefined reference to `SYS_enableInts'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:24: undefined reference to `SPR_init'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:28: undefined reference to `SPR_update'
/usr/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: /home/kentosama/Workspace/Projects/helloworld/src/main.c:29: undefined reference to `VDP_waitVSync'
collect2: error: ld returned 1 exit status
make: *** [Makefile:161: out/rom.out] Error 1
kentosama commented 4 years ago

Hello, I found how to fix the problem: add $(OBJ) at end.

$(SGDK)/lib/libmd_debug.a: $(OBJ)
    ar rs $(SGDK)/lib/libmd_debug.a **$(OBJ)**
drojaazu commented 4 years ago

Thanks! I never really did much testing with the debug build, so this is really helpful. I'll fix up the makefile unless you want to open a PR for the credit. :)

kentosama commented 4 years ago

Regardless, the most important thing is that it works :)