I can't get the GNUSH compiler to work right

I can't get the GNUSH compiler to work right

After looking through Takashi's tutorial, I was able to fix my .bat file to work with the SGL, though I'm not too sure if I have it configured perfectly. Unlike in the Cygnus Compiler, what's SETENV.bet in that one is I think GNU_SH_coff.bet in this compiler. Anyways, here's what I have in the bat file:

Code:
@Echo Off

Set PATH=C:\SS-SDK\Sh-coff\sh-coff\bin;C:\SS-SDK\OtherU~1;%PATH%

SET GCC_EXEC_PREFIX=C:\SS-SDK\Saturn\SGL\LIB\

SET INFOPATH=C:\SS-SDK\Saturn\SGL\INFO

SET C_INCLUDE_PATH=c:\SS-SDK\Saturn\SGL\INC

SET CPLUS_INCLUDE_PATH=c:\SS-SDK\Saturn\SGL\INC

SET TMPDIR=C:\TEMP

Set MAKE_MODE=win32

cmd "cd \" /k

It seems to work ok I guess, untill I try to compile something. I keep getting errors. Basically, this one:

Code:
objects:7: *** missing separator. Stop.

After getting some help on IRC, I found out something about these EOF(End of File) things at the end of like every single .c or .o file. So I get rid of all of them(even though I seriously doubt you're expected to do this with every since sample they give you), and try compiling again, only to ge more errors:

Code:
MAKE: *** No rule to make target `main.o', needed by `sl.coff'. Stop.

Does anyone have any idea what's going on? I just don't get it. There should be a tutorial for setting up the GNUSH compiler too cuz I had to look on IRC until I finally got someone to help me. Anyway, if anyone has any idea what's going on, please respond.

Thx
 
I can't get the GNUSH compiler to work right

Oh, I forgot to mention that also, the compiler can't even seem to recognize any MAKEFILEs unless I type "move MAKEFILE Makefile" , then type MAKE again, which is just another wierd mystery
blink.gif
 
I can't get the GNUSH compiler to work right

The answer to your second question is that for these tools, filenames are case-sensitive and the default name for makefiles has always been "Makefile". You can use the -f switch to supply a filename on the commandline.

TakaIsSilly might be able to answer your first question, as he apparently has a GNUSH-SGL environment set up.
 
I can't get the GNUSH compiler to work right

Ah, yes...

this is my GNU_SH_coff.bat:

Code:
@Echo Off

Set PATH=F:\DEVELO~1\SH\Sh-coff\bin;F:\DEVELO~1\SH\OtherU~1;%PATH%

SET INFOPATH=F:\DEVELO~1\SH\Sh-coff\INFO

SET C_INCLUDE_PATH=F:\DEVELO~1\SH\Sh-coff\include;F:\DEVELO~1\SH\Sh-coff\SGL\inc

SET CPLUS_INCLUDE_PATH=F:\DEVELO~1\SH\Sh-coff\include\cxx;F:\DEVELO~1\SH\Sh-coff\include;F:\DEVELO~1\SH\Sh-coff\SGL\inc

Set MAKE_MODE=unix

Cmd "cd\" /k

and the Makefile need this change to call the compiller correctly:

Code:
#

#  SEGA SATURN Graphic library make file for GNU

# macro

CC = sh-coff-gcc

LD = sh-coff-ld

RM = rm

CONV = sh-coff-objcopy

You might want to pass the files by DOS2UNIX as you said, as well, altough I didn't needed to. The Windows 95 Notepad (not the NT one) seems to piss all over the files when you save them, so that can be the problem.

http://www.bastet.com/software/UDDU.ZIP
 
I can't get the GNUSH compiler to work right

I suspect that Win9x doesn't pass the ^Z so that make/gcc never see it. I never had a problem with this in Win9x, but they're almost certainly causing the problem for XP/NT.
 
I can't get the GNUSH compiler to work right

I did everything u said, but get this error now

Code:
C:\SS-SDK\Saturn\SGL\SAMPLE2\SEGA2D_1>MAKE

sh-coff-gcc -m2 -L../../lib -Xlinker -T../common/sl.lnk -Xlinker -Map -Xlinker s

l.map -Xlinker -e -Xlinker ___Start -nostartfiles ../common/cinit.o ../../lib/sg

larea.o main.o scroll.o -lsgl -o sl.coff

MAKE: sh-coff-gcc: Command not found

MAKE: *** [sl.coff] Error 127

sad.gif


This doesn't make sense. I also prcessed all files through that prog u linked to. Nothing <_<
 
I can't get the GNUSH compiler to work right

IIRC, your gcc executable is just gcc. It really should be sh-coff-gcc, since it's not a native compiler, but for whatever reason I guess the package you got wasn't set up that way...
 
I can't get the GNUSH compiler to work right

Thank you SOOO much guys
wink.gif
It finally works. Just 1 min after erading your msg I was able to spot the problem. I have another question now. I made all the directorys as shown in Takashi's tutorial (MyProj, proj1), but I can't figure out how I edit my makefile to know the proper paths of my sources. Anyone able to tell me? This is what I have:

Code:
#

#  SEGA SATURN Graphic library make file for GNU

# macro

CC = sh-coff-gcc

LD = sh-coff-ld

RM = rm

CONV = sh-coff-objcopy

# directory

SGLDIR = ../..

SGLIDR = $(SGLDIR)/inc

SGLLDR = $(SGLDIR)/lib

CMNDIR = ../common

OBJECTS = ./objects

# option

CCFLAGS = -O2 -m2 -g -c -I$(SGLIDR)

# -m2 must be specified in LDFLAGS so the linker will search the SH2 lib dirs

# Specify path of libsgl.a by using "-L" option

LDFLAGS = -m2 -L$(SGLLDR) -Xlinker -T$(LDFILE) -Xlinker -Map \

     -Xlinker $(MPFILE) -Xlinker -e -Xlinker ___Start -nostartfiles

DFLAGS =

# source_program

include $(OBJECTS)

TARGET  = sl.coff

TARGET1 = sl.bin

LDFILE = $(CMNDIR)/$(TARGET:.coff=.lnk)

MPFILE  = $(TARGET:.coff=.map)

MAKEFILE = Makefile

all: $(TARGET) $(TARGET1)

# Use gcc to link so it will automagically find correct libs directory

$(TARGET) : $(SYSOBJS) $(OBJS) $(MAKEFILE) $(OBJECTS) $(LDFILE)

	$(CC) $(LDFLAGS) $(SYSOBJS) $(OBJS) $(LIBS) -o $@

$(TARGET1) : $(SYSOBJS) $(OBJS) $(MAKEFILE) $(LDFILE)

	$(CONV) -O binary $(TARGET) $(TARGET1)

#$(LDFILE) : $(MAKEFILE)

#	@echo Making $(LDFILE)

#	@echo SECTIONS { > $@

#	@echo SLSTART 0x06004000 : {	>> $@

#	@echo 	___Start = .;	>> $@

#	@echo 	*(SLSTART)	>> $@

#	@echo } 	>> $@

#	@echo .text ALIGN(0x20) : 	>> $@

#	@echo { 	>> $@

#	@echo 	* (.text) 	>> $@

#	@echo 	*(.strings) 	>> $@

#	@echo 	__etext = .; 	>> $@

#	@echo } 	>> $@

#	@echo SLPROG ALIGN(0x20): {	>> $@

#	@echo 	__slprog_start = .;	>> $@

#	@echo 	*(SLPROG)	>> $@

#	@echo 	__slprog_end = .;	>> $@

#	@echo } 	>> $@

#	@echo .tors ALIGN(0x10) : 	>> $@

#	@echo { 	>> $@

#	@echo 	___ctors = .; 	>> $@

#	@echo 	*(.ctors) 	>> $@

#	@echo 	___ctors_end = .; 	>> $@

#	@echo 	___dtors = .; 	>> $@

#	@echo 	*(.dtors) 	>> $@

#	@echo 	___dtors_end = .; 	>> $@

#	@echo } 	>> $@

#	@echo .data ALIGN(0x10): 	>> $@

#	@echo { 	>> $@

#	@echo 	* (.data) 	>> $@

#	@echo 	_edata = .; 	>> $@

#	@echo } 	>> $@

#	@echo .bss ALIGN(0x10) (NOLOAD): 	>> $@

#	@echo { 	>> $@

#	@echo 	__bstart = .; 	>> $@

#	@echo 	*(.bss) 	>> $@

#	@echo 	* ( COMMON ) 	>> $@

#	@echo 	__bend = .; 	>> $@

#	@echo _end = .; 	>> $@

#	@echo } 	>> $@

#	@echo }  >> $@

# suffix

.SUFFIXES: .asm

.c.o:

	$(CC) $< $(DFLAGS) $(CCFLAGS) -o $@

clean:

	$(RM) $(OBJS) $(TARGET:.coff=.*)

Just tell me where I edit it in. My path for proj1 is C:\SS-SDK\Saturn\SGL\MyProj\proj1 just incase it's needed...

Thx
smile.gif
 
I can't get the GNUSH compiler to work right

The Makefile isn't meant to be edited for each project; create/edit an 'objects' file for your project.
smile.gif
 
Back
Top