Path: chuka.playstation.co.uk!news From: James Tait Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: That dreaded Linux query again.... Date: Fri, 25 Sep 1998 23:44:39 +0100 Organization: Wyrd Dreams - Internet Realities Lines: 86 Message-ID: <360C1CD7.133D3870@wyrddreams.demon.co.uk> References: <360AF965.4D35F33B@wyrddreams.demon.co.uk> NNTP-Posting-Host: wyrddreams.demon.co.uk Mime-Version: 1.0 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.27 i586) A further development!  OK I've managed to get things working by reading lots of stuff on Makefiles and working back to a solution.  Basically I have the following Makefile:

CC      = psx-gcc
AS      = psx-as
LD      = psx-ld

LIBS    = -lps
LIBDIRS = -L/usr/lib/gcc-lib/psx/2.8.0

CFLAGS  = -funsigned-char -Wall
LDFLAGS = -EL -Ttext 80140000

OBJS    = pad.o main.o
PROG    = main

all:    $(PROG)

main:   $(OBJS)
        $(LD) $(LIBS) $(LIBDIRS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

%.o:    %.s
        $(AS) -o $@ $<

%.s:    %.c
        $(CC) -S $(CFLAGS) -o $@ $<
 
install:        $(PROG)
        psxfer -n$(PROG)
        psxfer -g

clean:
        rm *.o main

It's a little ugly but it works if I use make -r.  The only two problems I have are that I get a warning when I'm compiling:

  In file included from /usr/lib/gcc-lib/psx/2.8.0/include/strings.h:25,
                   from /usr/lib/gcc-lib/psx/2.8.0/include/string.h:14,
                   from main.c:9:
  /usr/lib/gcc-lib/psx/2.8.0/include/memory.h:32: warning: conflicting types for built-in function `memset'

And also I can't use anything that even vaguely refers to a non-integer number, e.g.:

#include <libps.h>
#include <stdio.h>

int main()
{
  int i;

  i = 100;
  printf("%d\n", i);  // works, prints out 100

  i = i/10;
  printf("%d\n", i);  // also works without trouble, prints out 10

  i = i * 0.1;  // barf-o-mania
  printf("%d\n", i); // never get this far, PSX has already crashed.
  return 0;
}

  I'd appreciate any help anyone could offer clearing these last couple of problems up.

-- 
Take care,

JT

                                    \\|//
                                    (O-O)
--------------------------------oOO--(_)--OOo---------------------------------
  "I can take you out with just a flick of my wrist" - Garbage (Supervixen)
e-mail: jt061@nova.mdx.ac.uk      Internet URL:  http://www.mdx.ac.uk/~jt061/
         Home: 01623 635037                     Mobile: 0956 652763