Re: Alpha and x86 development


Subject: Re: Alpha and x86 development
From: Christian Groessler (cpg@aladdin.de)
Date: Sun Aug 08 1999 - 05:35:32 PDT


Hi,

On 8/8/99 9:24:10 AM mgraffam wrote:
>
>Hello all..
>
>I was wondering if there was a trick to get gcc (and egcs) to put (and
>look for) all of the object code in a specified directory? Then I could
>have a sub-dirs called alpha_obj, sparc_obj, etc.. then each build could
>grab objects from there.

You can handle it in the Makefile. Do something like this:

# architecture (x86,alpha,sparc)
ARCH := $(shell uname -m | sed -e s/i.86/x86/ | sed -e s/i86pc/x86/ | sed
-e s/sun../sparc/)
# operating system
OSTYPE := $(shell uname -s | tr A-Z a-z)
# subdirectory where the objects will be stored
O = $(OSTYPE).$(ARCH)

CC= gcc

# platform-specific C-flags
CDEFS.linux=-DUNIX -DHAVE_ALLOCA_H -DNEED_SHMGETEVENTBASE -DHAVE_MATH_H \
         -DNEED_STRUPR -DNEED_O_BINARY -DHAVE_VALUES_H -DLINUX_MOUSE \
         -DLINUX_SOUND -DLINUX

# archit.-specific C-flags
CDEFS.alpha=-DNO_UNALIGNED
CDEFS.sparc=-DNO_UNALIGNED
CDEFS.x86=

# compiler debug flags, uncomment these if you will do debugging
CFLAGS= -g -Wall $(CDEFS.$(ARCH)) $(CDEFS.$(OSTYPE)) $(GOPTS)

all: dirs $(O)/result

dirs:
     @if [ ! -d $(O) ]; then rm -f $(O); mkdir $(O); fi

$(O)/%.o: %.c
     $(CC) $(CFLAGS) -c $< -o $@

regards,
chris

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com



This archive was generated by hypermail 2a22 : Tue Sep 07 1999 - 16:14:58 PDT