Page 20 of 57

Posted: Fri Oct 21, 2011 9:54 pm
by Zontar
Chilly Willy wrote:The .o files are made by the compiler from the appropriate .c files using the makefile. As long as you put together the toolchain as explained in the thread on that AND have done the exports mentioned, there shouldn't be any trouble other than convert from zasm to sjasm.

As for that, you might need to change a couple items, but I can't say what as I haven't done it myself. Just look at any errors sjasm gives and correct them. It's pretty straightforward.
Okay then, I got sjasm to work, however, md.o appears not be generating. I get this upon running make:
zontar@BPC-V-L:~/Programs/GenDev/qikexample/src$ make
sjasm z80_drv1.s80
SjASM Z80 Assembler v0.39g6 - www.xl2s.tk
Pass 1 complete (0 errors)
Pass 2 complete
Errors: 0
bintoc z80_drv1.o80
sjasm z80_drv2.s80
SjASM Z80 Assembler v0.39g6 - www.xl2s.tk
Pass 1 complete (0 errors)
Pass 2 complete
Errors: 0
bintoc z80_drv2.o80
make: *** No rule to make target `md.o', needed by `all'. Stop.

Posted: Sat Oct 22, 2011 8:02 pm
by Chilly Willy
Sorry, that's because I renamed sega.s into md.s. I felt sega.s was not quite descriptive enough since there are many sega consoles and boards.

Posted: Sun Oct 23, 2011 12:05 am
by Zontar
Chilly Willy wrote:Sorry, that's because I renamed sega.s into md.s. I felt sega.s was not quite descriptive enough since there are many sega consoles and boards.
Many thanks. :D I got it.

Posted: Wed Dec 07, 2011 4:25 pm
by Mixail
please, give me MakeFile for SGDK 0.9
I use it.

Posted: Wed Dec 07, 2011 10:03 pm
by Stef
Mixail wrote:please, give me MakeFile for SGDK 0.9
I use it.
Why you don't use directly the included makefile ?

Posted: Thu Dec 08, 2011 7:55 am
by Mixail
What files? i don't have it.
May MakeFile:

Code: Select all

GDK= ../../
CC= $(GDK)bin/gcc
OBJC= $(GDK)bin/objcopy
ASMZ80= $(GDK)bin/asmz80
BINTOC= $(GDK)bin/bintoc
NM= $(GDK)bin/nm
NM2WCH= $(GDK)bin/nm2wch
OUTPUT= Game
RESOL=bin


SRC_C= $(wildcard *.c)
SRC_S= $(wildcard *.s)
SRC_SZ80= $(wildcard *.s80)


OBJ= $(SRC_SZ80:.s80=.o)
OBJ+= $(SRC_C:.c=.o)
OBJ+= $(SRC_S:.s=.o)

LINKOBJ= $(GDK)lib/sega.o \
        $(GDK)lib/base.o \
        $(GDK)lib/tools.o \
        $(GDK)lib/vdp.o \
        $(GDK)lib/font.o \
        $(GDK)lib/vdp_bg.o \
        $(GDK)lib/vdp_dma.o \
        $(GDK)lib/vdp_pal.o \
        $(GDK)lib/vdp_spr.o \
        $(GDK)lib/vdp_tile.o \
        $(GDK)lib/bitmap.o \
        $(GDK)lib/z80_ctrl.o \
        $(GDK)lib/psg.o \
        $(GDK)lib/joy.o \
        $(GDK)lib/timer.o \
        $(OBJ)

INCS= -I$(GDK)include
FLAGS= $(OPTION) -m68000 -Wall -O1 -fomit-frame-pointer $(INCS)
FLAGSZ80= -c -i -x1 -x2 -x3 -z -lnul

all: $(OUTPUT).$(RESOL)
		

$(OUTPUT).$(RESOL): $(OUTPUT).out
	$(NM) -n -S -t x $(OUTPUT).out >$(OUTPUT).nm 
	$(NM2WCH) $(OUTPUT).nm $(OUTPUT).wch 
	$(OBJC) --pad-to 131072 -O binary $(OUTPUT).out $(OUTPUT).$(RESOL)

$(OUTPUT).out: $(OBJ)
	$(CC) -T $(GDK)bin/md.ld -nostdlib $(LINKOBJ) $(GDK)bin/libgcc.a -o $(OUTPUT).out


%.o80: %.s80
	$(ASMZ80) $(FLAGSZ80) -o$@ $<

%.c: %.o80
	$(BINTOC) $<

%.o: %.c
	$(CC) $(FLAGS) -c $< -o $@

%.o: %.s
	$(CC) $(FLAGS) -c $< -o $@
	
clean: 
	$(RM) *.o
	
	$(RM) *.out
	$(RM) *.wch
	$(RM) *.nm

But it does not work on SGDK 0.9

Posted: Fri Dec 09, 2011 11:53 am
by Mixail
Mixail wrote:please, give me MakeFile for SGDK 0.9
I use it.
Help me!

Posted: Fri Dec 09, 2011 12:48 pm
by KanedaFr
the makefile is at the root of the sdk
http://code.google.com/p/sgdk/source/br ... vn%2Ftrunk

its name is makefile.gen

Posted: Fri Dec 09, 2011 1:13 pm
by Stef
And if you download the main SGDK archive and follow the command line compilation tutorial you should get it easily.

Posted: Fri Dec 09, 2011 4:35 pm
by Mixail
KanedaFr wrote:the makefile is at the root of the sdk
http://code.google.com/p/sgdk/source/br ... vn%2Ftrunk

its name is makefile.gen
Thank you very much
but, now at compilation gives out an error 127.
Image
What to do?

Posted: Tue Dec 13, 2011 6:29 pm
by Mixail
Mixail wrote:
KanedaFr wrote:the makefile is at the root of the sdk
http://code.google.com/p/sgdk/source/br ... vn%2Ftrunk

its name is makefile.gen
Thank you very much
but, now at compilation gives out an error 127.
Image
What to do?
Why is this a bug (error)?
how to fix it?

Posted: Tue Dec 13, 2011 10:58 pm
by Chilly Willy
'rm' is the *nix command to remove a file. You don't appear to be using a cygwin or mingw command shell, but rather the Windows command shell. Windows' shell won't understand any *nix commands nor the paths used.

Posted: Wed Dec 14, 2011 8:41 am
by Stef
As far i remember SGDK provides the rm.exe file so you should get it.
You don't use SGDK as it is intended to be used, it's why you have some errors...

Posted: Wed Dec 14, 2011 11:47 am
by Mixail
There is something for a command line?

As my file for the old SGDK.
Mixail wrote:What files? i don't have it.
May MakeFile:

Code: Select all

GDK= ../../
CC= $(GDK)bin/gcc
OBJC= $(GDK)bin/objcopy
ASMZ80= $(GDK)bin/asmz80
BINTOC= $(GDK)bin/bintoc
NM= $(GDK)bin/nm
NM2WCH= $(GDK)bin/nm2wch
OUTPUT= Game
RESOL=bin


SRC_C= $(wildcard *.c)
SRC_S= $(wildcard *.s)
SRC_SZ80= $(wildcard *.s80)


OBJ= $(SRC_SZ80:.s80=.o)
OBJ+= $(SRC_C:.c=.o)
OBJ+= $(SRC_S:.s=.o)

LINKOBJ= $(GDK)lib/sega.o \
        $(GDK)lib/base.o \
        $(GDK)lib/tools.o \
        $(GDK)lib/vdp.o \
        $(GDK)lib/font.o \
        $(GDK)lib/vdp_bg.o \
        $(GDK)lib/vdp_dma.o \
        $(GDK)lib/vdp_pal.o \
        $(GDK)lib/vdp_spr.o \
        $(GDK)lib/vdp_tile.o \
        $(GDK)lib/bitmap.o \
        $(GDK)lib/z80_ctrl.o \
        $(GDK)lib/psg.o \
        $(GDK)lib/joy.o \
        $(GDK)lib/timer.o \
        $(OBJ)

INCS= -I$(GDK)include
FLAGS= $(OPTION) -m68000 -Wall -O1 -fomit-frame-pointer $(INCS)
FLAGSZ80= -c -i -x1 -x2 -x3 -z -lnul

all: $(OUTPUT).$(RESOL)
		

$(OUTPUT).$(RESOL): $(OUTPUT).out
	$(NM) -n -S -t x $(OUTPUT).out >$(OUTPUT).nm 
	$(NM2WCH) $(OUTPUT).nm $(OUTPUT).wch 
	$(OBJC) --pad-to 131072 -O binary $(OUTPUT).out $(OUTPUT).$(RESOL)

$(OUTPUT).out: $(OBJ)
	$(CC) -T $(GDK)bin/md.ld -nostdlib $(LINKOBJ) $(GDK)bin/libgcc.a -o $(OUTPUT).out


%.o80: %.s80
	$(ASMZ80) $(FLAGSZ80) -o$@ $<

%.c: %.o80
	$(BINTOC) $<

%.o: %.c
	$(CC) $(FLAGS) -c $< -o $@

%.o: %.s
	$(CC) $(FLAGS) -c $< -o $@
	
clean: 
	$(RM) *.o
	
	$(RM) *.out
	$(RM) *.wch
	$(RM) *.nm

But it does not work on SGDK 0.9

Posted: Wed Dec 14, 2011 5:29 pm
by Chilly Willy

Code: Select all

GDK= ../../
CC= $(GDK)bin/gcc
OBJC= $(GDK)bin/objcopy
ASMZ80= $(GDK)bin/asmz80
BINTOC= $(GDK)bin/bintoc
NM= $(GDK)bin/nm
NM2WCH= $(GDK)bin/nm2wch 
See those "/" characters? Windows shell hasn't the slightest idea what to do with those. It's a *nix path character - Windows uses "\" instead. Both cygwin and mingw have a *nix shell that understands BOTH path characters so that you can use *nix paths or Windows paths.