From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 27591 invoked from network); 8 Aug 1999 11:33:36 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 8 Aug 1999 11:33:36 -0000 Received: from saturn.aladdin.de (saturn.aladdin.de [194.123.19.3]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id HAA01002 for ; Sun, 8 Aug 1999 07:33:35 -0400 Received: by saturn.aladdin.de(Lotus SMTP MTA v4.6.2 (693.3 8-11-1998)) id 412567C7.0045EFF3 ; Sun, 8 Aug 1999 13:43:54 +0100 X-Lotus-FromDomain: AKS From: "Christian Groessler" To: axp-list@redhat.com Message-ID: <412567C7.0045EEE9.00@saturn.aladdin.de> Date: Sun, 8 Aug 1999 13:35:32 +0100 Subject: Re: Alpha and x86 development Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline 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