delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/26/13:12:19

Message-ID: <36AE0317.CF0A9BFE@geocities.com>
From: Sahab Yazdani <sahaby AT geocities DOT com>
X-Mailer: Mozilla 4.5 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Intermidate AND Final Directory
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990126094844 DOT 16926K-100000 AT is>
Lines: 67
Date: Tue, 26 Jan 1999 13:01:59 -0500
NNTP-Posting-Host: 209.5.16.57
X-Complaints-To: abuse AT sprint DOT ca
X-Trace: hme2.newscontent-01.sprint.ca 917373907 209.5.16.57 (Tue, 26 Jan 1999 13:05:07 EDT)
NNTP-Posting-Date: Tue, 26 Jan 1999 13:05:07 EDT
Organization: Sprint Canada Inc.
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

OK this helps, now my makefile looks something like this:

VPATH = e:/sahab/cproj/massacre/source;e:/sahab/cproj/massacre/inter

; Do you know of a better way of doing this?  If so, please E-mail me...
mass.exe : massacur.o object.o screen.o svga.o palette.o bitmap.o
sprite.o res...
        gcc -g -s massacur.o object.o svga.o screen.o palette.o bitmap.o
sprit...

%.o : %.cc
        gcc -g -c $< -o $@

clean :
        del inter/*.o
        del *.exe

It finds the source files in the source directory (sure enough) but puts
all the files in the root project directory...

So:

E:\SAHAB\CPROJ\MASSACRE\SOURCE> SOURCES sure enough
E:\SAHAB\CPROJ\MASSACRE> *.o and *.exe go here where I want it to put it
in
"    "    "       "    \INTER> is there something I'm missing?

Like do make the %.o : %.cc line read:

gcc -g -c $< -o E:/SAHAB/CPROJ/MASSACRE/INTER/$@  ?

THANX in ADVANCE...

Eli Zaretskii wrote:
> 
> On Mon, 25 Jan 1999, Sahab Yazdani wrote:
> 
> > In Borland C++, (AND Watcom I believe) you can select where the compiler
> > puts your intermidiate (.O) and release files (.EXE).  Can the same be
> > done with GCC?  Is there a command line function or something.
> 
> GCC has the -o switch that specifies where the compiler puts any files
> it produces.  For example:
> 
>               gcc -c foo.c -o c:/project/inter/foo.o
> 
> > Or do I have to declare it in my makefile?
> 
> In the Makefile, you can use the VPATH variable to tell the compiler
> where to find the sources.  For example:
> 
>       VPATH = c:/project/source;c:/project/inter
> 
> > C:\PROJECT\INTER> this is where all the useless files go (*.0) that I
> > can't use
> 
> Btw, if you compile and link in the same step, GCC deletes the object
> files automatically.

-- 
**********************************************************************
* Sahab Yazdani              * In wars, fools kill fools for foolish *
* Thornhill Secondary School *     reasons - Thom Merrilin (WoT)     *
**********************************************************************
* http://www.geocities.com/TimesSquare/Bunker/8994/index.html * Y2K? *
*     Click the link to visit my portion of The Neverhood     * A-OK *
**********************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019