help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make and source file path including


From: Fred J.
Subject: make and source file path including
Date: Sun, 24 Jul 2005 00:18:06 -0700 (PDT)

Hello

I read that "Executable programs sometimes do not
record the directories of the source files from which
they were compiled, just the names.

I have this arrangement

address@hidden:~/Exercies/ThinkingInC++/Vol1/C03$ tree
.
|-- makefile
|-- 13
|   |-- #rotation.cpp#
|   |-- bitwise.cpp
|   |-- makefile
|   |-- printBinary.cpp
|   |-- printBinary.h
|   |-- proj1
|   |-- rotation.cpp
|   `-- semantic.cache
|-- 14
|   |-- #makefile#
|   |-- main.cpp
|   |-- makefile
|   |-- proj1
|   |-- semantic.cache
|   `-- semantic.cache~

../14/makefile looks like this
**************************************************
include ../makefile

in the parent directory I have this makefile
**************************************************
OBJS = main.o
CFLAGS= -g -Wall
proj1 : $(OBJS)
        $(CXX) $(CFLAGS) -o $@ $(OBJS)          #CC -o proj1 $(OBJS)
the macro @ evaluates to the current target.

clean : 
        rm -f $(OBJS)

I did 
address@hidden:~/Exercies/ThinkingInC++/Vol1/C03/13$ make
which went ok.

how can I know if the executable programs did or did
not record the directories of the source files from
which it was compiled. and if it did what are they?

the reason I am asking is because when I 
Run gdb (like this): gdb
~/Exercies/ThinkingInC++/Vol1/C03/13/proj1 

I get
Current directory is
/home/sam/Exercies/ThinkingInC++/Vol1/C03/13/
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General
Public License, and you are welcome to change it
and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "i386-linux"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) break bitwise.cpp : 11
No source file named bitwise.cpp.  <-----this problem
Make breakpoint pending on future shared library load?
(y or [n]) 
(gdb) show directories 
Source directories searched: $cdir:$cwd
(gdb)

and while we are at it, how to fix this, because
(gdb) dir /home/sam/Exercies/ThinkingInC++/Vol1/C03/13

Source directories searched:
/home/sam/Exercies/ThinkingInC++/Vol1/C03/13:$cdir:$cwd
(gdb) show directories 
Source directories searched:
/home/sam/Exercies/ThinkingInC++/Vol1/C03/13:$cdir:$cwd
(gdb) break bitwise.cpp : 11
No source file named bitwise.cpp.
Make breakpoint pending on future shared library load?
(y or [n]) 

thanks


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]