From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric Lilja" Newsgroups: gmane.emacs.help Subject: M-x compile problem (path problem) Date: Tue, 15 Mar 2005 21:20:16 +0100 Organization: Island, Linkoping University, Sweden Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1110918333 9646 80.91.229.2 (15 Mar 2005 20:25:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 Mar 2005 20:25:33 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 15 21:25:32 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DBIaA-00029N-Jp for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Mar 2005 21:24:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DBIq7-0000Py-Af for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Mar 2005 15:40:31 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news-FFM2.ecrc.net!news.net.uni-c.dk!newsfeed.sunet.se!news01.sunet.se!news.island.liu.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: astmatix.ida.liu.se Original-X-Trace: news.island.liu.se 1110918011 11468 130.236.186.15 (15 Mar 2005 20:20:11 GMT) Original-X-Complaints-To: abuse@island.liu.se Original-NNTP-Posting-Date: Tue, 15 Mar 2005 20:20:11 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Original Original-Xref: shelby.stanford.edu gnu.emacs.help:129290 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: news.gmane.org gmane.emacs.help:24843 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24843 Hello, I'm using the "CVS version" 22.0.50.1 (from early february) and I recently encountered a problem with M-x compile. I'm using emacs to write code for, compile and debug c and c++. Anyway, before I had the Makefile and all sources files in the same directory and all files generated during the build process (object files, executable etc) was created in that directory. I decided that I should place all source files in subdirectory called source and all generated object files should go in a subdirectory called obj. So in the "primary" directory I would have just the Makefile, the compiled executable and the two subdirectories src/ and obj/. I changed my Makefiles to look for the source files in the src/ subdirectory and to place the object files in the obj/ subdirectory. But then when I tried to use debug mode (M-x gdb) it didn't find a symbol table but I solved that by adding ../name_of_executable to Run gdb (like this): gdb --annotate=3 ../name_of_executable If I try compile mode (M-x compile) it doesn't work because it cant find the Makefile, so I added -f ../Makefile but it still won't work because the paths in the Makefile are relative paths to the parent directory of the src/ subdirectory. So how do I solve this problem? I can see three solutions, and I don't like any of those three. 1. Edit the Makefile so that the paths in it are relative to the src directory, but then I can't compile if from the shell if I'm not in the src directory. 2. Have two Makefiles, where the second one is the src directory with relative paths adapted to its location. 3. Go back to keep everything in the same directory but I dont want that. Anyone have any other solutions?? Ouch, this got longish, hope you understood my problem / Eric