Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Christian Groessler" <cpg@aladdin.de>
To: axp-list@redhat.com
Subject: Re: Alpha and x86 development
Date: Sun, 8 Aug 1999 13:35:32 +0100	[thread overview]
Message-ID: <412567C7.0045EEE9.00@saturn.aladdin.de> (raw)



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



             reply	other threads:[~1999-08-08 11:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-08 12:35 Christian Groessler [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-08-08  8:24 Alpha and x86 development mgraffam
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox